Skip to content
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

Merged
merged 7 commits into from
Apr 12, 2024
Merged

Modify benchmarks #563

merged 7 commits into from
Apr 12, 2024

Conversation

dacorvo
Copy link
Collaborator

@dacorvo dacorvo commented Apr 11, 2024

What does this PR do?

Modify LLM benchmarks section:

  • now evaluates decode throughput only,
  • updated numbers for LLama 7b and Llama 13b using AWS Neuron SDK 2.18,
  • added Mistralv2

@dacorvo dacorvo marked this pull request as ready for review April 11, 2024 11:59
@HuggingFaceDocBuilderDev

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.

Comment on lines 31 to 32
def get_input_ids(tokens, batch_size, input_length):
return tokens.input_ids[:, :input_length].repeat((batch_size, 1))
Copy link
Member

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.

Comment on lines 23 to 39

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)
Copy link
Member

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.

Comment on lines +22 to +23
with open("./wiki.txt") as f:
prompt = f.read()
Copy link
Member

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?

Copy link
Collaborator Author

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

@dacorvo dacorvo merged commit c8f15f9 into main Apr 12, 2024
1 check passed
@dacorvo dacorvo deleted the modify-benchmarks branch April 12, 2024 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants