Skip to content

test(compile): cover stateful MoE and shared attention replay - #10

Open
yu-chen-code wants to merge 1 commit into
masterfrom
feat-graph-model-state
Open

yu-chen-code wants to merge 1 commit into
masterfrom
feat-graph-model-state

Conversation

@yu-chen-code

@yu-chen-code yu-chen-code commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

What type of PR is this?
/kind feature

What does this PR do / why do we need it:

Refreshed on 2026-11-09 against fork/upstream master a6be99d3. PR1421 is now merged upstream, so its duplicate prerequisite has been removed. Current head: 0c367cb0d1c730fc186e038664c7c4bee6b3b803; retained feature/dependency commits: 0c367cb0. Git range-diff confirms unchanged feature patches. Focused CPU regression on this exact head: 106 JUnit records, 0 failures, 0 errors. The isolated refresh environments now include master-required PEFT 0.21.2 and accelerate 1.13.0; pip check passes. All numerical runs and older source hashes below are pre-refresh evidence. NPU precision training and formal upstream CI were not rerun for this rebase.

Add focused joint-graph regression coverage for state that changes across training steps. The tests use the existing V4.1 router and shared compressed-attention state carrier. They check routing auxiliary loss, backward token counters, optimizer-step bias updates, gradient accumulation, and one shared-bank producer with multiple differentiable consumers.

Run the same cases with activation checkpointing disabled, full, and selective. The tests ensure recomputation does not count routed tokens twice and that replay consumes current model buffers. The incremental commit after the shared prerequisite is test-only coverage; it changes no eager or compiler production behavior and adds no new state-management abstraction.

The shared-state fixture covers the carrier's producer/consumer gradient contract. It does not establish complete DeepSeek-V4.1 Full/Reindex/Reuse attention, mHC, LI, or end-to-end DSA support.

Validation:

  • CPU: the two new tests and all five checkpointing subcases passed.
  • Ascend 910B2, Torch 2.15.0.dev20261005 / torch-npu 2.15: four ranks, FSDP4, ten AdamW updates, two microbatches per update. Router and shared-state fixtures each passed with checkpointing off/full/selective.
  • Identical initial tensors and deterministic inputs. Loss relative error <= 7.67e-8; gradient relative L2 <= 6.90e-7; updated parameter relative L2 <= 5.53e-8. Router counters and bias were checked exactly. The fixed acceptance contract was 1e-3 with denominator floor 1e-8.
  • Public CI pylint configuration passed with both Python 3.9 and 3.12 targets. No performance claim is made.

Exact source manifests, commands, before/after tensor receipts and raw failures are retained under T020 runs/20261106-graph-capability-spikes. No formal upstream gate is requested or claimed.

Which issue(s) this PR fixes:

None.

Code review checklist [illustration]:

  • whether to verify the function's return value (It is forbidden to use void to mask the return values of security functions and self-developed functions. C++ STL functions can be masked if there is no problem)
  • Whether to comply with SOLID principle / Demeter's law
  • Whether there is UT test case && the test case is a valid (if there is no test case, please explain the reason)
  • Whether the API change is involved
  • Whether official document modification is involved

@yu-chen-code
yu-chen-code force-pushed the feat-graph-model-state branch from 4136aa7 to 0c367cb Compare November 9, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant