You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adapt Codegen to native module-family preparation so generated model source visibly preserves the selected module replacements and forward patches for review and debugging.
Reuse native model construction, replacement decisions and Planner results without changing Trainer or component APIs, creating process groups, or initializing accelerator devices during generation.
Emit concrete module constructors at their construction sites where supported; preserve source-module wrapping where required. Reuse existing layer preparation loops for imported constructors.
Reuse native imports for unchanged family members and helper types; retain source-visible CP/EP forward changes without copying entire component implementations.
Separate SDPA CP dispatch from the preserved local forward to prevent recursive re-entry in generated source.
Observe factory-tail forward changes before publication and validate that recorded patches are materialized in the emitted source.
Fix Kimi CP closure emission: recognize native-context-derived CP size/rank bindings and reuse existing runtime CP expressions, without freezing the observed rank or querying real communication groups during generation. Unsupported captures still fail explicitly.
Regenerate the tracked bundles for DeepSeek-V3, DeepSeek-V3.2, Kimi-K2.6 and Qwen3-MoE. This PR does not modify native model adapters, data batching or Trainer execution.
Validation for 32f9214b8f89a120607b91e2a29777a94e253c54:
Local and server 129 Codegen UT: 253 passed and 37 subtests passed on each environment.
All four tracked model configurations passed CLI/Trainer-sidecar file-inventory and SHA256 comparison, with three regular files per bundle. All 12 committed bundle files match the verified outputs.
The additional Kimi CP2 configuration passed single-process offline generation and CLI/sidecar byte parity. Its generated closure was checked against native behavior for both CP ranks; observation rank does not change the emitted source.
Offline resource guards, local pylint, lizard and AGENTS catalog checks passed.
After the final complexity cleanup, all four recipe bundles remained byte-identical to the previous verified outputs; the additional Kimi CP2 bundle also remained byte-identical to the initial closure fix.
DeepSeek-V3 validation retains the existing TP1 override. The committed Kimi bundle follows its canonical CP1 recipe; the additional CP2 artifacts remain in isolated validation output. No training or loss-alignment run is claimed by this validation.
Which issue(s) this PR fixes:
N/A — no issue is automatically closed by this PR.
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
Special notes for your reviewers:
Generated source is intended for review and debugging; generated-model training support and loss alignment are outside this change.
@shawny999, your gate pipeline failed at the code check stage. You can configure some code check tools locally following the (pre-push quick guide), to enable automatic checking when you push your code every time. Tools included are: Check_CMakelint, Check_Codespell, Check_Cpplint, Check_Lizard, Check_Pylint, Check_ClangFormat, Check_ShellCheck.
🔵 The pipeline #2165 is running. Please wait a moment... (Link)
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
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.
Paired: GitHub #1640 ↔ GitCode !2009
What type of PR is this?
/kind bug
/kind refactor
What does this PR do / why do we need it:
Adapt Codegen to native module-family preparation so generated model source visibly preserves the selected module replacements and forward patches for review and debugging.
Validation for
32f9214b8f89a120607b91e2a29777a94e253c54:DeepSeek-V3 validation retains the existing TP1 override. The committed Kimi bundle follows its canonical CP1 recipe; the additional CP2 artifacts remain in isolated validation output. No training or loss-alignment run is claimed by this validation.
Which issue(s) this PR fixes:
N/A — no issue is automatically closed by this PR.
Code review checklist [illustration]:
Special notes for your reviewers: