Repository navigation
feat: support opt-in multi-adapter MoE LoRA waves - #1139
Merged
Merged
Conversation
Keep independent adapter ownership through canonical root slicing and checkpoint recomputation. Reject segmented routed experts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Capture grouped-backward opt-in at forward, preserve main stride failures by default, and route empty segmented FC1 dependencies through the owning slots. Align expert rejection assertions with the production guard and cover gated/non-gated and conflicting-context boundaries on CPU. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Retain original slot ownership through native EP1 dispatch and recomputation. Keep TE row geometry and router aux/z/capacity computations per adapter; reuse compact expert kernels and leave ordinary forwards unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run each independent root through the existing attention backend with cached root-local masks. The full-model trace localizes the remaining forward drift to layer 3 attention with exact Q/K/V inputs. Preserve native execution outside an explicit segmented scope. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # src/art/megatron/lora.py
Reuse native-repeat d17408e0 lowering and regression tests verbatim. Add an explicit native execution scope that enables the standard determinism opt-in without changing root geometry. Native controls and ART defaults retain their existing execution. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Capture independent-root reduction scope on FLA autograd contexts. Keep recurrent GEMMs batched while using batch-one scalar cumsum geometry in forward and backward. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use the existing LoRA checkpoint context capture to carry the opt-in GDN reduction scope onto autograd worker threads. Add thread and real recurrence checkpoint regressions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contexts created before the explicit installer retain native reductions. Flagged MoE contexts follow the identical captured-scope path qualified in 8d8b173. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Include the dense fixture GQA geometry and 65-token tail, with and without LSE gradients. Scope the FLASH-specific regression to SM90 because Blackwell already selects Triton. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 355fccefcec8c5827a2a7be74a65df5724de4f79)
Reset Dynamo between independent model geometries and reject its unfused debug fallback. Shared test specialization history exhausted the compile cache, changed LSE conventions and violated the unchanged FP64 gate; do not widen that tolerance. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 3b4517eca0179058fac520ac19ee425c148a9142)
Keep the deterministic opt-in on its compiled backward lowering when Dynamo exhausts specialization capacity. Preserve default eager behavior and cover the cache transition with a failing-first CPU regression. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit e23d04821f29e4ac9f03f07d9e4bc4f1b709855d)
The router, expert-plan and GDN capture tests import Megatron, which the backend unit-test environment lacks. Run those three files with the other Megatron lightweight tests and exclude them from the backend run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Agent: Shazeer
Problem. #1135 lets dense canonical adapters share one decoder forward and backward, but it rejects routed experts. MoE, where many small adapters gain the most from fusion, stayed on one pass per adapter. A naive fused MoE pass failed the same-state gradient gate. The combined batch changed:
Behavior. New explicit installers and scopes let several adapters share one MoE decoder pass, while each adapter keeps its native per-adapter numerics:
execution(None, numerical_policy="native", deterministic_native=True)scopes PyTorch determinism. FLASH forward is kept, and backward uses deterministic Triton. If execution falls out of compilation, it now raises rather than silently using the eager path.Nothing changes unless a caller installs these and enters the scopes, with one exception: callers that already enable PyTorch determinism with FLASH now get the Triton backward. On main, strict mode raises
NotImplementedErrorfor masked FLASH, and warn-only runs the nondeterministic FLASH backward. Determinism-off behavior is unchanged. OpenPipe/caladan will enable MoE waves only behindSTARK_FUSED_WAVES=1, under a versionednative-moe-wave-v1policy (separate PR).This PR carries the native-repeat lane's whole deterministic attention change:
d17408e0, with355fccef,3b4517ecande23d0482cherry-picked. That lane doesn't need its own ART PR.Validation.
a0bd182a, was NOT CLEAR. Its one P2: deterministic FLASH could silently fall back to eager attention after Dynamo's recompile limit. It also raised a P3 on test portability.f47f793c, is CLEAR-WITH-NOTES.fab384edruns them in the Megatron step instead. A third review, at this headfab384ed, is also CLEAR-WITH-NOTES.Limitations.
🤖 Generated with Claude Code