Repository navigation
[Paged Stash] Add integration tests for cuda_graphable_moe experiment - #3218
Merged
Merged
Conversation
- Add AVAILABLE_MEMORY_POLICIES registry to passes.py so experiments can register custom memory policies without modifying graph_trainer code. - Refactor tag_with_memory_policy_pass to dispatch via the registry. - Change memory_policy config from Literal to str for extensibility. - Add _get_extra_graph_passes hook to GraphTrainer for subclasses to inject additional graph passes into the aot_fx_trace pipeline. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> [ghstack-poisoned]
Paged stash SAC for MoE expert activations: pre-allocated paged buffers store dynamic-shaped _grouped_mm outputs for the backward pass, avoiding both recomputation cost and memory fragmentation from variable token counts. - Joint-graph pass (paged_stash_graph_pass.py): inserts paged_stash.copy/pop ops using ao's stream infrastructure, redirecting backward consumers through paged buffers so SAC+remat naturally ignores stashed activations. - PagedStashTrainer (train.py): extends GraphTrainer with 3-level overflow defense (host spillover, cross-rank detection, retry with buffer growth). - Memory policy registration: paged_stash and paged_stash_save_only policies. - Fine-grained annotation via annotate_fn on _run_experts_grouped_mm. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> [ghstack-poisoned]
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> [ghstack-poisoned]
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> [ghstack-poisoned]
This was referenced May 4, 2026
added 2 commits
May 5, 2026 20:17
…da_graphable_moe experiment" Co-Authored-By: Claude Opus 4.7 (1M context) <noreplyanthropic.com> [ghstack-poisoned]
… experiment" Co-Authored-By: Claude Opus 4.7 (1M context) <noreplyanthropic.com> [ghstack-poisoned]
syed-ahmed
requested review from
SherlockNoMad,
aditvenk,
sanketpurandare,
tianyu-l,
xmfan and
yiming0416
as code owners
May 6, 2026 03:17
xmfan
approved these changes
May 7, 2026
…da_graphable_moe experiment" Co-Authored-By: Claude Opus 4.7 (1M context) <noreplyanthropic.com> [ghstack-poisoned]
… experiment" Co-Authored-By: Claude Opus 4.7 (1M context) <noreplyanthropic.com> [ghstack-poisoned]
…da_graphable_moe experiment" Co-Authored-By: Claude Opus 4.7 (1M context) <noreplyanthropic.com> [ghstack-poisoned]
… experiment" Co-Authored-By: Claude Opus 4.7 (1M context) <noreplyanthropic.com> [ghstack-poisoned]
SherlockNoMad
pushed a commit
that referenced
this pull request
May 7, 2026
…#3215) Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom): * #3218 * #3217 * #3216 * __->__ #3215 - Add AVAILABLE_MEMORY_POLICIES registry to passes.py so experiments can register custom memory policies without modifying graph_trainer code. - Refactor tag_with_memory_policy_pass to dispatch via the registry. - Change memory_policy config from Literal to str for extensibility. - Add _get_extra_graph_passes hook to GraphTrainer for subclasses to inject additional graph passes into the aot_fx_trace pipeline. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: root <[email protected]>
…da_graphable_moe experiment" Co-Authored-By: Claude Opus 4.7 (1M context) <noreplyanthropic.com> [ghstack-poisoned]
… experiment" Co-Authored-By: Claude Opus 4.7 (1M context) <noreplyanthropic.com> [ghstack-poisoned]
added 2 commits
August 27, 2026 16:08
…da_graphable_moe experiment" AI assistant used: Claude Opus 4.7 (1M context) <noreplyanthropic.com> [ghstack-poisoned]
… experiment" AI assistant used: Claude Opus 4.7 (1M context) <noreplyanthropic.com> [ghstack-poisoned]
added 2 commits
September 29, 2026 16:34
…da_graphable_moe experiment" AI assistant used: Claude Opus 4.7 (1M context) <noreplyanthropic.com> [ghstack-poisoned]
… experiment" AI assistant used: Claude Opus 4.7 (1M context) <noreplyanthropic.com> [ghstack-poisoned]
SherlockNoMad
approved these changes
Sep 29, 2026
…da_graphable_moe experiment" AI assistant used: Claude Opus 4.7 (1M context) <noreplyanthropic.com> [ghstack-poisoned]
… experiment" AI assistant used: Claude Opus 4.7 (1M context) <noreplyanthropic.com> [ghstack-poisoned]
…da_graphable_moe experiment" AI assistant used: Claude Opus 4.7 (1M context) <noreplyanthropic.com> [ghstack-poisoned]
… experiment" AI assistant used: Claude Opus 4.7 (1M context) <noreplyanthropic.com> [ghstack-poisoned]
…da_graphable_moe experiment" AI assistant used: Claude Opus 4.7 (1M context) <noreplyanthropic.com> [ghstack-poisoned]
… experiment" AI assistant used: Claude Opus 4.7 (1M context) <noreplyanthropic.com> [ghstack-poisoned]
syed-ahmed
added a commit
that referenced
this pull request
Oct 8, 2026
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom): * #3218 * #3217 * __->__ #3216 Paged stash SAC for MoE expert activations: pre-allocated paged buffers store dynamic-shaped _grouped_mm outputs for the backward pass, avoiding both recomputation cost and memory fragmentation from variable token counts.
tianyu-l
approved these changes
Oct 8, 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.
Stack from ghstack (oldest at bottom):
AI assistant used: Claude Opus 4.7 (1M context) [email protected]