Skip to content

Disable FlexAttention max-autotune when deterministic is used - #1808

Merged
fegin merged 3 commits into
mainfrom
chienchin/disable_flex_max_autotune
Oct 8, 2025
Merged

fegin merged 3 commits into
mainfrom
chienchin/disable_flex_max_autotune

Conversation

@fegin

@fegin fegin commented Oct 7, 2025 •

Copy link
Copy Markdown
Contributor

With max-autotune, FlexAttention is not deterministic even if torch.use_deterministic_algorithms is True. When deterministic mode is set, we should also remove the usage of max-autotune.

With max-autotune, FlexAttention is not deterministic even if torch.use_deterministic_algorithms is True. Add a flag to disable max-autotune. Since this this is a debug flag, we use environment variables to implement this flag.

DISABLE_TORCHTITAN_FLEX_MAX_AUTOTUNE is the flag.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 7, 2025
Comment thread torchtitan/models/attention.py Resolved
@fegin fegin changed the title Add an environment variable to disable FlexAttention max-autotune Disable FlexAttention max-autotune when deterministic is used Oct 7, 2025
@fegin
fegin requested a review from wwwjn October 7, 2025 23:00

@wwwjn wwwjn left a comment

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.

LGTM!

@fegin
fegin merged commit 41eff53 into main Oct 8, 2025
githubsgi pushed a commit to githubsgi/torchtitan that referenced this pull request Oct 13, 2025
…h#1808)

With max-autotune, FlexAttention is not deterministic even if
torch.use_deterministic_algorithms is True. When deterministic mode is
set, we should also remove the usage of `max-autotune`.
githubsgi pushed a commit to githubsgi/torchtitan that referenced this pull request Oct 15, 2025
…h#1808)

With max-autotune, FlexAttention is not deterministic even if
torch.use_deterministic_algorithms is True. When deterministic mode is
set, we should also remove the usage of `max-autotune`.
githubsgi pushed a commit to githubsgi/torchtitan that referenced this pull request Oct 16, 2025
…h#1808)

With max-autotune, FlexAttention is not deterministic even if
torch.use_deterministic_algorithms is True. When deterministic mode is
set, we should also remove the usage of `max-autotune`.
githubsgi pushed a commit to githubsgi/torchtitan that referenced this pull request Oct 16, 2025
…h#1808)

With max-autotune, FlexAttention is not deterministic even if
torch.use_deterministic_algorithms is True. When deterministic mode is
set, we should also remove the usage of `max-autotune`.
githubsgi pushed a commit to githubsgi/torchtitan that referenced this pull request Oct 29, 2025
…h#1808)

With max-autotune, FlexAttention is not deterministic even if
torch.use_deterministic_algorithms is True. When deterministic mode is
set, we should also remove the usage of `max-autotune`.
githubsgi pushed a commit to githubsgi/torchtitan that referenced this pull request Oct 29, 2025
…h#1808)

With max-autotune, FlexAttention is not deterministic even if
torch.use_deterministic_algorithms is True. When deterministic mode is
set, we should also remove the usage of `max-autotune`.
@fegin
fegin deleted the chienchin/disable_flex_max_autotune branch December 8, 2025 20:07
xrsrke pushed a commit to NousResearch/torchtitan that referenced this pull request Feb 13, 2026
…h#1808)

With max-autotune, FlexAttention is not deterministic even if
torch.use_deterministic_algorithms is True. When deterministic mode is
set, we should also remove the usage of `max-autotune`.
xrsrke pushed a commit to NousResearch/torchtitan that referenced this pull request Feb 25, 2026
…h#1808)

With max-autotune, FlexAttention is not deterministic even if
torch.use_deterministic_algorithms is True. When deterministic mode is
set, we should also remove the usage of `max-autotune`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants