Skip to content

[DONT LAND] Full Dtensor fully_shard + Local Map + FlexAttention - #2621

Closed
fegin wants to merge 2 commits into
gh/fegin/101/basefrom
gh/fegin/101/head
Closed

fegin wants to merge 2 commits into
gh/fegin/101/basefrom
gh/fegin/101/head

Conversation

@fegin

@fegin fegin commented Mar 18, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

./run_train.sh --module qwen3 --config qwen3_debugmodel_flex --training.full-dtensor --training.steps 100 --compile.enable
./run_train.sh --module llama3 --config llama3_debugmodel_flex_attn --training.full-dtensor --training.steps 100 --compile.enable

[ghstack-poisoned]
fegin added a commit that referenced this pull request Mar 18, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 18, 2026
[ghstack-poisoned]
fegin added a commit that referenced this pull request Mar 18, 2026
# Infer placements from the input DTensors
cache_key = (q.placements, k.placements, v.placements)
if cache_key not in cached_fn:
cached_fn[cache_key] = local_map(

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.

so, iiuc, orig_fn is actually fine with handling whatever placements q,k,v have?

i guess i'd expect we assert that q,k,v,o placements are valid sdpa strategy placements. how does orig_fn tell which placements it's working with at runtime?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

At this point, this PR just demonstrates how to use forward swap to achieve the local map. We will get the placements from configurations.

@tianyu-l tianyu-l closed this Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/8gpu 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