extend bucket_internal to SAMPLE generation mode#84
Merged
4 commits merged intoMar 2, 2024
Merged
Conversation
| if generation_config.static_shapes and generation_config.bucket_size > 0: | ||
| assert ( | ||
| generation_mode == GenerationMode.GREEDY_SEARCH or generation_mode == GenerationMode.BEAM_SEARCH | ||
| generation_mode == GenerationMode.GREEDY_SEARCH or generation_mode == GenerationMode.SAMPLE |
There was a problem hiding this comment.
Lets have the check of BEAM SEARCH too since bucketing changes from Sayantan works in beam search.
| model_kwargs["lazy_mode"] = lazy_mode | ||
| model_inputs = self.prepare_inputs_for_generation(input_ids, **model_kwargs) | ||
|
|
||
| if bucket_size > 0 and bucket_internal: |
There was a problem hiding this comment.
These changes should be after model fwd call.
2. move internal bucket update after forward
|
@dvarshney-habana - Changes look good to me. We can merge so that sampling search starts working with bucket_internal. |
ghost
approved these changes
Mar 2, 2024
astachowiczhabana
pushed a commit
that referenced
this pull request
Apr 19, 2024
* extend bucket_internal to SAMPLE generation mode * 1. copy bucket only related code from greedy to sample 2. move internal bucket update after forward * fix format * remove clear_cache
astachowiczhabana
pushed a commit
that referenced
this pull request
Apr 22, 2024
* extend bucket_internal to SAMPLE generation mode * 1. copy bucket only related code from greedy to sample 2. move internal bucket update after forward * fix format * remove clear_cache
astachowiczhabana
pushed a commit
that referenced
this pull request
Apr 24, 2024
* extend bucket_internal to SAMPLE generation mode * 1. copy bucket only related code from greedy to sample 2. move internal bucket update after forward * fix format * remove clear_cache
astachowiczhabana
pushed a commit
that referenced
this pull request
Apr 24, 2024
* extend bucket_internal to SAMPLE generation mode * 1. copy bucket only related code from greedy to sample 2. move internal bucket update after forward * fix format * remove clear_cache
This pull request was closed.
This file contains hidden or 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
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.
What does this PR do?
Extend function #24 to sample mode.

The command to reproduce performance is as follows:
python ../gaudi_spawn.py --use_deepspeed --world_size 4 run_generation.py --model_name_or_path meta-llama/Llama-2-70b-hf --use_hpu_graphs --use_kv_cache --max_input_tokens 128 --max_new_tokens 2048 --batch_size 240 --attn_softmax_bf16 --trim_logits --bf16 --reuse_cache --warmup 1 --n_iterations 1 --limit_hpu_graphs --do_sample --bucket_size 256 --bucket_internal