Skip to content

docs: document flash attention supports_mapping#46013

Open
nightcityblade wants to merge 1 commit into
huggingface:mainfrom
nightcityblade:fix/issue-45995
Open

docs: document flash attention supports_mapping#46013
nightcityblade wants to merge 1 commit into
huggingface:mainfrom
nightcityblade:fix/issue-45995

Conversation

@nightcityblade
Copy link
Copy Markdown
Contributor

What does this PR do?

Documents the supports_mapping argument in _process_flash_attention_kwargs and fixes the docstring section heading from Return to Returns.

Fixes #45995

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case. Issue: docs: Add missing parameter documentation #45995
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests? No new tests were needed for this docstring-only change; ran python3 -m py_compile src/transformers/modeling_flash_attention_utils.py and python3 -m ruff check src/transformers/modeling_flash_attention_utils.py.

Who can review?

Documentation: @stevhliu
Attention: @vasqu @ArthurZucker @Cyrilvallez

Copy link
Copy Markdown
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

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

thanks!

The maximum sequence length in the key/value tensor during a varlen forward.
Return:
supports_mapping (`dict[str, bool]`, *optional*):
Mapping indicating whether each flash attention feature is supported by the active backend.
Copy link
Copy Markdown
Member

@stevhliu stevhliu May 18, 2026

Choose a reason for hiding this comment

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

just specifying the wording a bit more :)

Suggested change
Mapping indicating whether each flash attention feature is supported by the active backend.
A dict containing the underlying information of the Flash Attention function on its supported parameters. Keys are all valid parameters (and alternative names) across all standards and values indicate whether each parameter could be found in the active backend's signature. For more information, please check `_lazy_define_process_function` that creates this mapping.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we take a similar description to #45153?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

updated to match the existing description

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