Repository navigation
🚨 Fix GPTBigCode and GPTNeoX for the Transformers modelling backend for vLLM - #47198
Conversation
… vLLM Signed-off-by: Harry Mellor <[email protected]>
Signed-off-by: Harry Mellor <[email protected]>
Signed-off-by: Harry Mellor <[email protected]>
Signed-off-by: Harry Mellor <[email protected]>
| _skip_keys_device_placement = ["past_key_values"] | ||
| _supports_flash_attn = True | ||
| _supports_sdpa = True | ||
| _supports_attention_backend = True |
There was a problem hiding this comment.
its weird that it does not auto detect it n o? normally it reads the code to seeif attn interface is used. can you check why it failed here?
There was a problem hiding this comment.
Where is auto-detection supposed to happen?
The method in Transformers just checks for this class attribute:
transformers/src/transformers/modeling_utils.py
Lines 4823 to 4825 in 8ca0fbe
There was a problem hiding this comment.
ahh my bad then might have been there at some point in can_set_attn_implementation ? they don't oberlap i guess
There was a problem hiding this comment.
Oh that's nice, I didn't know about this method. As a follow up I can update is_backend_compatible to check this as well as the kwargs passing and then _supports_attention_backend becomes redundant
|
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. |
Signed-off-by: Harry Mellor <[email protected]>
Signed-off-by: Harry Mellor <[email protected]>
|
[For maintainers] Suggested jobs to run (before merge) run-slow: gpt_bigcode, gpt_neox |
CI recapDashboard: View test results in Grafana |
…or vLLM (huggingface#47198) * Fix GPTBigCode and GPTNeoX for the Transformers modelling backend for vLLM Signed-off-by: Harry Mellor <[email protected]> * make style Signed-off-by: Harry Mellor <[email protected]> * unnecessary change Signed-off-by: Harry Mellor <[email protected]> * remove pointless comment Signed-off-by: Harry Mellor <[email protected]> * Only apply to causal class Signed-off-by: Harry Mellor <[email protected]> --------- Signed-off-by: Harry Mellor <[email protected]>
…or vLLM (huggingface#47198) * Fix GPTBigCode and GPTNeoX for the Transformers modelling backend for vLLM Signed-off-by: Harry Mellor <[email protected]> * make style Signed-off-by: Harry Mellor <[email protected]> * unnecessary change Signed-off-by: Harry Mellor <[email protected]> * remove pointless comment Signed-off-by: Harry Mellor <[email protected]> * Only apply to causal class Signed-off-by: Harry Mellor <[email protected]> --------- Signed-off-by: Harry Mellor <[email protected]>
…or vLLM (huggingface#47198) * Fix GPTBigCode and GPTNeoX for the Transformers modelling backend for vLLM Signed-off-by: Harry Mellor <[email protected]> * make style Signed-off-by: Harry Mellor <[email protected]> * unnecessary change Signed-off-by: Harry Mellor <[email protected]> * remove pointless comment Signed-off-by: Harry Mellor <[email protected]> * Only apply to causal class Signed-off-by: Harry Mellor <[email protected]> --------- Signed-off-by: Harry Mellor <[email protected]>
…5.14.0 - The GPTNeoXForCausalLM embed_out→lm_head rename landed in transformers 5.14.0 (huggingface/transformers#47198), not 5.13; fix the docstring/comment/test references that said 5.13 or ~5.14 - Rename test_unembed_resolves_against_transformers_5_13_lm_head_layout to _5_14_ so it no longer contradicts the locked-5.13.0-still-has-embed_out fallback test - Leave the four "locked 5.13.0 still exposes embed_out" notes unchanged — that pairing is correct
…1752) * fix(neox): resolve unembedding as lm_head for transformers >= 5.13 - Map the NeoX bridge unembed component to `lm_head` instead of the removed `embed_out`, so `TransformerBridge.boot_transformers` boots GPT-NeoX/Pythia on the pinned transformers 5.13.0 instead of raising `AttributeError: 'GPTNeoXForCausalLM' object has no attribute 'embed_out'`. - Mirror the same rename on the HookedTransformer weight-conversion path so the bridge and legacy systems stay consistent (AGENTS §2). - Found while generalizing Backward Lens to dense-MLP families, which needs pythia-70m as an `out_in` integration model. * test(neox): cover unembedding resolution on the transformers >= 5.13 layout - Update the top-level HF-path assertion to expect the `lm_head` unembed name. - Add a model-free regression test that resolves the unembed component against a module exposing `lm_head` (and not `embed_out`) via `get_remote_component`, guarding against reintroducing the stale name that broke GPT-NeoX/Pythia boot. * fix(neox): resolve unembedding on both embed_out and lm_head layouts CI's locked transformers==5.13.0 still exposes embed_out; the earlier lm_head-only rename only matched later transformers versions (5.15.1 in the local conda env), breaking every pythia/GPT-NeoX boot in CI. Resolve the unembed name at runtime (bridge: ArchitectureAdapter.prepare_model once the real HF module is available; HookedTransformer: hasattr in convert_neox_weights) so both layouts work. * fix(neox): guard component_mapping before unembed lookup - assert component_mapping is not None in prepare_model before indexing "unembed" - narrows ComponentMapping | None so mypy allows the subscript (fixes index error) * fix(neox): correct transformers embed_out→lm_head rename boundary to 5.14.0 - The GPTNeoXForCausalLM embed_out→lm_head rename landed in transformers 5.14.0 (huggingface/transformers#47198), not 5.13; fix the docstring/comment/test references that said 5.13 or ~5.14 - Rename test_unembed_resolves_against_transformers_5_13_lm_head_layout to _5_14_ so it no longer contradicts the locked-5.13.0-still-has-embed_out fallback test - Leave the four "locked 5.13.0 still exposes embed_out" notes unchanged — that pairing is correct * refactor(neox): set unembed name via components accessor in prepare_model - Replace the redundant `assert component_mapping is not None` + `isinstance(unembed, UnembeddingBridge)` guard with a direct `self.components["unembed"].name = "embed_out"` assignment. - The `components` accessor already asserts the mapping is built and `.name` is declared on GeneralizedComponent, matching how bert.py and other adapters edit their mapping; keep the hasattr `if` guard as-is.
embed_outtolm_headfor GPTNeoX_supports_attention_backend = Trueto GPTBigCode because it does