Repository navigation
Merge deepseek-ai/DeepGEMM main (public release 26/11/26, #525) into dev - #177
Merged
Merged
Conversation
A CUDA graph kernel node keeps the same %gridid on every replay. The mega_mhc split barriers tag each execution with %gridid, so after a replay a barrier line still holds encode_state(grid_idx, kNumSplits), which is exactly the state the next replay waits for. A Mix or Norm waiter whose m-block init CTA has not started yet proceeds immediately and reads the previous replay's split partials. Tag executions with an epoch instead. The epoch and an exit count live in the unused tail of the first barrier line, so the host-side buffer is unchanged. Every CTA reads the epoch after cudaGridDependencySynchronize, and the last CTA to retire resets the exit count and advances the epoch. Signed-off-by: lightseek-bot <[email protected]>
* Public release 26/11/26 * Add 2026.11.26 News entry for deepseek-ai#525
…#525) into dev Mega MoE keeps dev's kernels (NVFP4, TRT-LLM layouts, SiTU, norm, SIMT pull, SM103 K96 / SM107 K128) at upstream's renamed *_inference paths, with upstream's async-proxy fences ported into the FP8/FP4 and BF16 kernels and the L2 k-block dependency waits. Upstream's *_inference Python names alias dev's functions; upstream's deep_gemm/mega_moe package is not taken. Mega mHC takes upstream's kernel (Shifted only) with dev's in-CTA Norm, task queue, FlashInfer 128x4 SF and non-exclusive TMEM on top. The launch is cooperative only without the SM107 oversized shared-memory mode (CUDA 720 otherwise), and in-CTA Norm defaults off for the dual routed/shared SF output at hidden >= 7168. GEMM/HC: upstream bias path, FP32 HC prenorm input, FP8 stochastic rounding epilogue in the sgl binding; sgl tests match cuBLASLt's 'splitKreduce' since the bench L2 flush now launches a torch reduce kernel. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Git carried the three PRs' edits through the *_inference renames. Co-Authored-By: Claude Opus 5.5 <[email protected]>
zcnrex
marked this pull request as ready for review
November 28, 2026 18:36
aryatsc
added a commit
to aryatsc/DeepGEMM
that referenced
this pull request
Nov 28, 2026
Brings in sgl-project#177 (deepseek-ai public release 26/11/26, deepseek-ai#525) and deepseek-ai#478. No textual conflicts: this branch's changes follow the renames (csrc/apis/mega_moe.hpp -> mega_moe_inference.hpp, impls/sm100_fp8_fp4_mega_moe.{hpp,cuh} -> ..._inference.{hpp,cuh}, scheduler/mega_moe.cuh -> scheduler/mega_moe/inference.cuh).
This was referenced Nov 30, 2026
Jzz1943
pushed a commit
to Jzz1943/DeepGEMM
that referenced
this pull request
Dec 1, 2026
The upstream merge (sgl-project#177) added a 2D-only `check_sf_layout` to `FP8CastWithClampEpilogue::check`, which rejects the 4D `[ceil(m / 128), n / 128, 32, 4]` SFD that `fp8_einsum` accepts since sgl-project#136. DeepSeek V4.1's FP8 `wo_a` einsum (FlashInfer `wo_b` handoff) asserted at server warmup. Validate the 4D shape there as `fp8_einsum` does, and add the 4D case to the sgl einsum test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Merges deepseek-ai/DeepGEMM
main(public release 26/11/26, deepseek-ai#525) intodev. Parents aredev(c7b056f, #165) and upstream09e7d8e7. A second merge brings indevup to 12be8d3 (#169, #178, #171). Git carried their edits through the*_inferencerenames, and each file's changed lines match dev's own diff.What the merge keeps
*_inferencepaths. Upstream's async-proxy fences and L2 k-block dependency waits are ported into the FP8/FP4 and BF16 kernels. Upstream's*_inferencePython names alias dev's functions. Upstream'sdeep_gemm/mega_moepackage is not taken.get_num_splitsis kept, because dev's split refinement measured 3.5–5.2% slower on 3 rows.Fixes on top of a plain merge
CU_SHARED_MEMORY_MODE_ALLOW_OVERSIZED_SHARED_MEMORY(in-CTA Norm). The launch is now cooperative only when oversized mode is not used; that mode already keeps one CTA per SM resident.y_shared_sfand hidden >= 7168), andDG_MHC_IN_CTA_NORMoverrides the default.reduce→splitKreduce. Upstream's bench L2 flush now launches a torchreduce_kernel, so the old kineto name matched twice. Upstream's own tests already usesplitKreduce.Validation
Base is #165 (65167ac, same tree as
devc7b056f) against this merge. Both arms run on the same GPU in ABBA order with 2 reps each. A row is flagged when merge/base > 1.03 and more than twice the A/A spread. "Geo" is the merge/base geomean; lower is faster.Tests. The full sgl suite passes on SM107 (VR) and on B300, except for failures that also occur on base:
test_mega_moe.pybf16xbf16, 2-rank, graph replay: IMA inside DeepEPsymmetric.hpp. It failed 3/3 on base and 3/3 on merge. The cause is the BF16 kernel's shared-memory layout, fixed by [SM100] BF16 Mega MoE: share expert counts and send buffers in smem #178, which is now merged in here (not re-run on B300).test_cublaslt_batched_syrkdiff 7.2e-7, plus DeepEP NCCL IBRETRY_EXC_ERRin the multi-rank Mega MoE tests (environment).Upstream's FP32/BF16-input HC test passes.
After the dev re-sync (SM107, base =
dev12be8d3, ABBA). Both suites give 25 passed, 3 failed, with the same 3 failures (the syrk tolerance and the DeepEP IB errors above).The fp8xfp4 decode rows are a harness artifact, not a kernel cost. Upstream changed
bench_kineto's L2 flush from.zero_()to.sum(), and each arm imports its owndeep_gemm.testing. Two bisect runs on SM107 (8 reps per cell, timed from HBM GB/s) show this:nvlink_barriersync removed.sum()flush.zero_()flushThe vs-#165 numbers below (1.011 / 1.006) have the same cause.
* B300 decode T32 has 30% A/A noise.
E2E (SM107, internal NVFP4 mega-MoE model, DEP16 on 16 GPUs, ABBA arms). Both arms load their own
deep_gemmpackage; this was checked on every rank.E2E (SM107, open NVFP4 MoE model with BF16 Mega MoE layers, TP4/EP4 on 4 GPUs, layernorm-SP prefill through Mega MoE, prefill CUDA graphs on). Base =
dev12be8d3, merge = this branch.Before #178, this model crashed at startup on both base and merge (illegal memory access in the BF16 Mega MoE layers).
Open items (not in this PR)
test_mega_moe_sgl.pyruns the legacy-baseline bench even for MMA types it skips for correctness (e.g.nvfp4xnvfp4). When DeepEP is installed, it fails the SF-shape assert on both base and merge. To get the B300 NVFP4 EP numbers above, the bench was gated oncan_compare_bitwisein both arms.🤖 Generated with Claude Code