KEMBAR78
flash_paged: s_aux may not exist by pcuenca · Pull Request #40434 · huggingface/transformers · GitHub
Skip to content

Conversation

@pcuenca
Copy link
Member

@pcuenca pcuenca commented Aug 25, 2025

Some implementations (i.e.,
https://huggingface.co/kernels-community/vllm-flash-attn3) support an s_aux arg for attention sinks, but others
(https://huggingface.co/kernels-community/flash-attn) do not. If s_aux is present in the kwargs, we forward it, otherwise we don't.

The user will still get an error if they use a model like gpt-oss-20b with an implementation that does not support s_aux, but models that don't use it won't error out. For example, this is currently failing because we are sending s_aux: None in the dict. We get:

TypeError: flash_attn_varlen_func() got an unexpected keyword argument 's_aux'

Some implementations (i.e.,
https://huggingface.co/kernels-community/vllm-flash-attn3) support an
`s_aux` arg for attention sinks, but others
(https://huggingface.co/kernels-community/flash-attn) do not. If s_aux
is present in the kwargs, we forward it, otherwise we don't.

The user will still get an error if they use a model like gpt-oss-20b
with an implementation that does not support `s_aux`, but models that
don't use it won't error out. For example, [this is currently
failing](https://github.com/huggingface/transformers/blob/399cd5c04b11ba3f740b4f76e8067326786405cc/examples/pytorch/continuous_batching.py#L16)
because we are sending `s_aux: None` in the dict.
@pcuenca pcuenca requested a review from ArthurZucker August 25, 2025 15:11
@HuggingFaceDocBuilderDev

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.

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

absolutely! thanks for the fix

@ArthurZucker ArthurZucker merged commit 58cebc8 into main Aug 26, 2025
22 of 25 checks passed
@ArthurZucker ArthurZucker deleted the s_aux_opt branch August 26, 2025 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants