Skip to content

Conversation

@fegin
Copy link
Contributor

@fegin fegin commented Oct 7, 2025

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
@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
Copy link
Contributor

@wwwjn wwwjn left a comment

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
8 checks passed
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`.
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.

3 participants