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

Add tool to evaluate NeuronModelForCausalLM perplexity #692

Closed
wants to merge 2 commits into from

Conversation

dacorvo
Copy link
Collaborator

@dacorvo dacorvo commented Sep 6, 2024

What does this PR do?

This adds a small script that can evaluate the perplexity of a standard pytorch or Neuron LLM on a configurable dataset (defaults to WikiText).

Results for some models:

model float perplexity neuron perplexity
Llama3-8B-Instruct 8.37 8.39
llama3.1-8B-Instruct 7.32 7.33

By default, transformers_neuronx model only return the logits for the
last input token, i.e. those leading to the generated token.
This modifies the default behaviour for models that support it (all but
gpt2), but only when batch_size is 1.
This does not have too much impact on performance and allows to evaluate
the model perplexity.
This script can be used to evaluate the perplexity of a float or neuron
LLM model using a configurable dataset (WikiText by default).
@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.

@dacorvo
Copy link
Collaborator Author

dacorvo commented Sep 30, 2024

Obsoleted by EleutherAI/lm-evaluation-harness#2314

@dacorvo dacorvo closed this Sep 30, 2024
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.

2 participants