Skip to content

[compiler toolkit] Add graph based SAC#2377

Merged
yiming0416 merged 1 commit intomainfrom
yiming/graph_ac
Feb 26, 2026
Merged

[compiler toolkit] Add graph based SAC#2377
yiming0416 merged 1 commit intomainfrom
yiming/graph_ac

Conversation

@yiming0416
Copy link
Contributor

@yiming0416 yiming0416 commented Feb 13, 2026

Add graph-based SAC as a joint graph pass in alternative to eager-mode AC. Previously eager AC and fullmodel trace don't compose in DSv3 (See #1935). With graph based AC, it's no longer an issue.

Set --compile.joint_passes apply_sac to turn it on

Llama3-8B (TP=2, FSDP=2)
no-AC: memory: 67.19GiB(37.67%) tps: 9,569 tflops: 554.17 mfu: 24.63%
eager SAC: memory: 45.88GiB(25.73%) tps: 8,627 tflops: 499.62 mfu: 22.21%
graph SAC: memory: 44.20GiB(24.78%) tps: 8,007 tflops: 463.74 mfu: 20.61%

DeepSeek-v3 Debug model(TP=2, FSDP=2, EP=2)
no-AC: memory: memory: 12.26GiB(6.88%) tps: 59,927 tflops: 32.54 mfu: 1.45%
eager SAC: doesn't work (due to AC HOP mutation issue #1935)
graph SAC: memory: 11.01GiB(6.17%) tps: 53,939 tflops: 29.29 mfu: 1.30%

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Feb 13, 2026
@yiming0416 yiming0416 force-pushed the yiming/graph_ac branch 2 times, most recently from 1930e2c to 4899761 Compare February 13, 2026 20:44
@yiming0416 yiming0416 changed the title [compiler toolkit] Add graph based AC [compiler toolkit] Add graph based SAC Feb 13, 2026
@yiming0416 yiming0416 marked this pull request as ready for review February 13, 2026 20:47
}


def apply_sac_pass(
Copy link
Contributor

Choose a reason for hiding this comment

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

How will user pass the op_list_to_save from command line?

Can we re-use the existing AC config system to configure apply_sac_pass?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently the ops to be saved in SAC are in a hardcoded list for each model.
Not sure if it's a good UX for user to pass from command line though, as the list itself could be pretty long and not cli-friendly

@yiming0416 yiming0416 force-pushed the yiming/graph_ac branch 2 times, most recently from 6daa539 to 9558d43 Compare February 25, 2026 23:12
@yiming0416 yiming0416 force-pushed the yiming/graph_ac branch 2 times, most recently from 641f6c5 to 50e5b7f Compare February 26, 2026 00:00
@yiming0416 yiming0416 merged commit 6a74d74 into main Feb 26, 2026
24 checks passed
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.

2 participants