Backport GPTBigCodeAttention from v4.53.0 to avoid major refactoring.#2271
Merged
Conversation
Signed-off-by: Artur Kloniecki <arturx.kloniecki@intel.com>
|
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. |
pbielak
reviewed
Sep 19, 2025
Signed-off-by: Artur Kloniecki <arturx.kloniecki@intel.com>
astachowiczhabana
pushed a commit
that referenced
this pull request
Sep 22, 2025
…#2271) Signed-off-by: Artur Kloniecki <arturx.kloniecki@intel.com>
gplutop7
pushed a commit
to HabanaAI/optimum-habana-fork
that referenced
this pull request
Oct 15, 2025
…huggingface#2271) (huggingface#706) Signed-off-by: Artur Kloniecki <arturx.kloniecki@intel.com> Co-authored-by: Artur KlonieckiX <arturx.kloniecki@intel.com>
gplutop7
pushed a commit
to HabanaAI/optimum-habana-fork
that referenced
this pull request
Nov 6, 2025
…huggingface#2271) (huggingface#706) Signed-off-by: Artur Kloniecki <arturx.kloniecki@intel.com> Co-authored-by: Artur KlonieckiX <arturx.kloniecki@intel.com>
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?
Between transformers versions v4.53 and v4.54, a major refactor of GPTBigCodeAttention was made. This caused our GaudiBPTBigCodeAttention implementation incompatible.
This PR backports
_get_mask_value()function from version v4.53, as well as overwritesattn_dropoutproperty to make it an operator once again, as it was being stored as a scalar in v4.54+, and used in newforward()implementation differently than before.This reenables text generation using bigcode, i.e:
cd examples/text-generationpip install -r requirements.txtexport PT_HPU_ENABLE_REFINE_DYNAMIC_SHAPES=1PT_HPU_LAZY_MODE=1 python3 ../gaudi_spawn.py --world_size 1 run_generation.py --batch_size 1 --bf16 --model_name_or_path bigcode/starcoder --use_hpu_graphs --use_kv_cache --n_iterations 1 --max_new_tokens 100