Add: DeepSeek-V4 FLASH full 43-layer decode network as an EP2 scene test - #1838
Merged
ChaoZheng109 merged 2 commits intoAug 14, 2026
Merged
Conversation
|
Important Review skippedToo many files! This PR contains 373 files, which is 273 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (373)
You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
lwDavid
force-pushed
the
add-dsv4-flash-decode-ep2-example
branch
3 times, most recently
from
August 14, 2026 09:08
767c6b1 to
d0e9c92
Compare
Port the complete DeepSeek-V4 FLASH decode forward from pypto-lib (models/deepseek_v4_flash_mtp/decode_fwd.py) as the first pypto-harvested distributed example: a level-3 scene test on 2 dies with expert-parallel MoE dispatch/combine and a TP2 LM head through a comm domain. - examples/a2a3/tensormap_and_ringbuffer/deepseek_v4_flash_decode/: harvested chip orchestration (7.8k lines) + 367 incore kernels, verbatim pypto codegen plus license headers, clang-format, and the whole-word renames L2TaskArgs->ChipTaskArgs / L0TaskArgs->CoreTaskArgs / Tensor->ChipTensor (pypto's pinned runtime predates the role-based naming contract). - The scene orch fn transcribes the generated host_orch.py: one comm domain (12 window buffers, ~6.6 MiB), 92 tensors + 13 scalars per rank, per-rank submits. Stacked per-rank slices become independent _r0/_r1 host tensors (the rehost passes whole buffers), and pypto's device-resident weight upload becomes plain host tensor args. - simpler_setup/goldens/deepseek_v4_flash_decode.py: deterministic fixture for the 80 network parameters (~100 GiB at full size), metadata transcribed exactly, weight distributions matching the upstream spec builders. - The case is manual (367-kernel compile takes minutes) and skip_golden (upstream runs the same fixture with golden_fn=None; numeric coverage lives with the standalone kernel harnesses in pypto-lib). - .pre-commit-config.yaml: exclude the harvested orchestration translation unit from check-added-large-files (708 KiB is inherent to the 43-layer program).
ChaoZheng109
previously approved these changes
Aug 14, 2026
…orchestration The harvested whole-network chip orchestration decode_fwd.cpp is 725 350 bytes (~708 kB) — one generated translation unit whose size is inherent to the 43-layer program. Keep it under the hook's scrutiny by raising the global cap from the 500 kB default to 750 kB rather than excluding its directory.
ChaoZheng109
approved these changes
Aug 14, 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.
What
Add the DeepSeek-V4 FLASH full 43-layer decode network (EP2/TP2, 2 dies) as an a2a3
tensormap_and_ringbufferscene test — the first pypto-harvested distributed network example in the repo. The single-chip counterpart isqwen3_14b_decode/; the raw-Workermulti-chip counterpart isexamples/workers/l3/ep_dispatch_combine/.examples/a2a3/tensormap_and_ringbuffer/deepseek_v4_flash_decode/: harvested chip orchestration (7.8k lines) + 367 incore kernels from pypto-libmodels/deepseek_v4_flash_mtp/decode_fwd.py(pypto289290e6, pypto-libef88d34, ptoas v0.57, pto-isa83d01313). Codegen output is verbatim apart from three mechanical transforms: license headers, repo clang-format, and the whole-word renamesL2TaskArgs->ChipTaskArgs/L0TaskArgs->CoreTaskArgs/Tensor->ChipTensor(pypto's pinned runtime predates the role-based naming contract).host_orch.py: one comm domain (12 window buffers, ~6.6 MiB — MoE meta/payload/route, arrival counters, LM-head hidden/logits windows), 92 tensors + 13 scalars per rank, per-ranksubmit_next_level.simpler_setup/goldens/deepseek_v4_flash_decode.py: deterministic ~100 GiB fixture for the 80 network parameters. Stacked per-rank tensors become independent_r0/_r1args (the rehost passes whole buffers); metadata (block tables, routing tid2eid, positions, freqs) is bitwise-equal to the upstream builder; pypto's device-resident weight upload becomes plain host tensor args (verified equivalent upstream: the network passes with residency stripped).manual(the 367-kernel compile takes minutes — it stays out of the default sweep) andskip_golden(upstream drives the same fixture withgolden_fn=None; numeric coverage lives with pypto-lib's standalone kernel harnesses). What it pins down: the harvested distributed program compiles, both ranks dispatch, the cross-die window protocol drains, and the run terminates cleanly.Status
Blocked on the #1644 pto-isa pin bump — see issue #1839. The case PASSES on every runtime from #1729 (wire-ABI cutover) through #1771, all pinning pto-isa
83d01313; from7a1b9b11(pto-isa ->0cefc9a5) onward, including main, both ranks stall mid-network in the comm-window polling path (full bisect matrix and candidate pto-isa commits in the issue). Landing the example gives that regression an in-tree repro; themanualmarker keeps CI green meanwhile.Testing
TestDeepseekV4FlashDecode::DecodeFwdEP2TP2PASSED standalone on a2a3 (2 dies) ataa1d7c7d,cf0fbc06, and4b13b69cwith these exact sources.ruff check/ruff formatclean on the two Python files; all 368.cppfiles pass the repoclang-formatcheck.