Skip to content

fix eager_eval with kv cache and improve pybind eval speed #4720

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

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

helunwencser
Copy link
Contributor

@helunwencser helunwencser commented Aug 14, 2024

The existing eager_eval fails to run when kv is enabled due to using the wrong pos_tensor. This PR fixes it.

The pybind_eval is extremely slow right now. This PR improves its speed based on #3732.

Test Plan:

  • before
2024-08-14:14:43:31,158 INFO     [task.py:395] Building contexts for wikitext on rank 0...
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 949.71it/s]
2024-08-14:14:43:31,163 INFO     [evaluator.py:362] Running loglikelihood_rolling requests
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5/5 [35:57<00:00, 431.58s/it]
wikitext: {'word_perplexity,none': 48.05348672811993, 'word_perplexity_stderr,none': 'N/A', 'byte_perplexity,none': 2.130418826812418, 'byte_perplexity_stderr,none': 'N/A', 'bits_per_byte,none': 1.0911370830175748, 'bits_per_byte_stderr,none': 'N/A', 'alias': 'wikitext'}
  • after
2024-08-14:15:40:33,050 INFO     [task.py:395] Building contexts for wikitext on rank 0...
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 890.17it/s]
2024-08-14:15:40:33,056 INFO     [evaluator.py:362] Running loglikelihood_rolling requests
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5/5 [01:53<00:00, 22.71s/it]
wikitext: {'word_perplexity,none': 48.0195983759526, 'word_perplexity_stderr,none': 'N/A', 'byte_perplexity,none': 2.13012529989619, 'byte_perplexity_stderr,none': 'N/A', 'bits_per_byte,none': 1.0909382962830712, 'bits_per_byte_stderr,none': 'N/A', 'alias': 'wikitext'}

Copy link

pytorch-bot bot commented Aug 14, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/4720

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 9d20532 with merge base 1cb97e0 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 14, 2024
@facebook-github-bot
Copy link
Contributor

@helunwencser has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@helunwencser has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot merged commit a54d62c into main Aug 16, 2024
35 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants