forked from mlc-ai/mlc-llm
-
Notifications
You must be signed in to change notification settings - Fork 8
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 sampling penalties and logit bias #125
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
masahi
reviewed
Dec 20, 2023
sunggg
previously requested changes
Dec 20, 2023
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.
Thank you @cyx-6!
I'm getting error when I run serve/benchmarks/benchmark_throughput.py
.
/opt/bin/cuda-reserve.py --num-gpu 1 python3 serve/benchmarks/benchmark_throughput.py --local-id llama-2-7b-chat-hf-q0f16-presharded-1gpu --use-staging-engine --dataset /opt/models/dataset/ShareGPT_V3_unfiltered_cleaned_split.json
Traceback (most recent call last):
File "/home/spark/mlc-llm/serve/mlc_serve/engine/staging_engine_worker.py", line 374, in run_generation_loop_worker
output = worker.step()
File "/home/spark/mlc-llm/serve/mlc_serve/engine/staging_engine_worker.py", line 224, in step
results = self.text_generator.generate(requests, self.cache_manager.get_cache())
File "/home/spark/mlc-llm/serve/mlc_serve/model/paged_cache_model.py", line 605, in generate
out.extend(self.model.generate(decode_requests, kv_cache))
File "/home/spark/mlc-llm/serve/mlc_serve/model/paged_cache_model.py", line 479, in generate
next_tokens = sample(logits, sampling_params, self.vocab_size, appeared_token_freqs=self.appeared_token_freqs)
File "/home/spark/mlc-llm/serve/mlc_serve/model/paged_cache_model.py", line 99, in sample
freq = appeared_token_freqs[i]
IndexError: list index out of range
Would you take a look? After this fix, it would be nice to share the numbers on H100 before/after this PR to understand its performance impact.
This PR adds the sampling penlaties of frequency penalty and presence penalty. Also it adds the logit bias.
cyx-6
force-pushed
the
sampler-features
branch
from
December 20, 2023 19:12
a9f440c
to
78c1390
Compare
masahi
reviewed
Dec 20, 2023
masahi
reviewed
Dec 20, 2023
masahi
reviewed
Dec 20, 2023
masahi
reviewed
Dec 20, 2023
masahi
reviewed
Dec 20, 2023
masahi
approved these changes
Dec 20, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the sampling penlaties of frequency penalty and presence penalty. Also it adds the logit bias.