[GraphTrainer][AutoDev] Remove compile_with_inductor annotation from qwen3 FlexAttention#3019
Merged
SherlockNoMad merged 1 commit intomainfrom Apr 20, 2026
Conversation
…xAttention The qwen3 graph_trainer parallelize.py annotated FlexAttention.forward with compile_with_inductor metadata, but the llama3 and deepseek_v3 variants do not have this annotation. This divergence could cause subtle issues when FlexAttention is shared across models. Remove the annotation from qwen3 to align all graph_trainer model variants.
yiming0416
approved these changes
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
compile_with_inductorannotation onFlexAttention.forwardin the qwen3 graph_trainer parallelize module to align with llama3 and deepseek_v3 variants, which do not have this annotation.Why
The qwen3
annotate_qwen3function taggedFlexAttention.forwardwith{"compile_with_inductor": "flex_attention"}metadata, but the llama3 and deepseek_v3 graph_trainer variants do not annotate FlexAttention this way. SinceFlexAttentionis a shared component (torchtitan/models/common/attention.py), annotating itsforwardmethod in one model variant but not others causes a global mutation that persists across all models in the same process, which could cause subtle behavioral divergence depending on model initialization order.This PR removes the annotation from qwen3 so all three graph_trainer model variants are consistent.
Test plan
from torchtitan.experiments.graph_trainer.qwen3.parallelize import annotate_qwen3, parallelize_qwen3)