-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modify benchmarks #563
Modify benchmarks #563
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
280f41c
to
7875e94
Compare
def get_input_ids(tokens, batch_size, input_length): | ||
return tokens.input_ids[:, :input_length].repeat((batch_size, 1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: if tokens.input_ids
initially has a batch size > 1 the output will have a batch size of batch_size x original_batch_size
, maybe just select the first batch before the repeat.
|
||
for model_name, model_configuration in model_configurations.items(): | ||
model_id, batch_size, seq_length = model_configuration | ||
model = NeuronModelForCausalLM.from_pretrained( | ||
model_id, | ||
export=True, | ||
batch_size=batch_size, | ||
sequence_length=seq_length, | ||
auto_cast_type="bf16", | ||
num_cores=NUM_CORES, | ||
) | ||
with TemporaryDirectory() as tmpdir: | ||
model.save_pretrained(tmpdir) | ||
tokenizer = AutoTokenizer.from_pretrained(model_id) | ||
tokenizer.save_pretrained(tmpdir) | ||
json_path = f"{model_name}.json" | ||
run(tmpdir, 256, 2048, json_path=json_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add if __name__ == "__main__"
to not run this code at any import.
with open("./wiki.txt") as f: | ||
prompt = f.read() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You read a 12k lines document and you tokenize everything at once?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, tokenizer is a brute
What does this PR do?
Modify LLM benchmarks section: