Skip to content

Public release 26/11/26 - #525

Merged
zheanxu merged 2 commits into
mainfrom
release-26-11-26
Nov 26, 2026
Merged

zheanxu merged 2 commits into
mainfrom
release-26-11-26

Conversation

@zheanxu

@zheanxu zheanxu commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

This update introduces new features, performance improvements, and API refinements:

New features

  • Mega MoE inference: added optional fused RMSNorm after combine (BF16/FP32 output).
  • GEMM: added deep_gemm.epilogue.FP8StochasticRounding and [1, N] bias support for BF16 and FP8/FP4 GEMMs.
  • Experimental kernels (deep_gemm.experimental): added experimental kernels (no stability guarantees), including fused BF16 GEMM + SwiGLU / (bias) + add + RMSNorm,
    batched_bf16_newton_schulz, fp8_gemm_nt_segmented_k256, and fused decoding kernels (v41f_qkv_lora, v41f_wv_o_proj).

Performance improvements

  • Mega MoE inference: low-latency optimizations, batched dispatch pulling, reduced atomic traffic, and streaming stores for combine reduce.
  • GEMM heuristics: tuned L2 swizzle heuristics and TMA store stage selection for deeper input pipelines.
  • Mega mHC: host-resolved norm partitioning and faster BF16 conversion / exp computation.

Fixes

  • Fixed missing async global proxy fences and tail task draining in Mega MoE inference.
  • Removed %gridid dependency in Mega mHC split barriers for safe CUDA graph replay.

API changes

  • Mega MoE inference APIs are renamed to *_inference; legacy names remain available via deep_gemm.mega_moe.compat.
  • mega_mhc now supports Shifted mode only (Normal mode removed).

zheanxu added a commit that referenced this pull request Nov 26, 2026
@zheanxu
zheanxu merged commit 09e7d8e into main Nov 26, 2026
zyongye added a commit to vllm-project/DeepGEMM that referenced this pull request Nov 28, 2026
* Public release 26/09/30 (deepseek-ai#462)

Add locality-aware Mega MoE execution, GEMM epilogue classes with BF16
stochastic rounding, wider sparse MQA head support, and packed SF strides.
Improve Indexer and Mega MoE pipelines, update attention and Mega Gate
interfaces, and include runtime and correctness fixes.

Export the current source through the OSS filter while retaining public
release history and the Mega MoE task-info release-ordering fix.

Co-authored-by: Anyi Xu <[email protected]>
Co-authored-by: huahuaquq <[email protected]>
Co-authored-by: TwenTy_ <[email protected]>
Co-authored-by: xyf007 <[email protected]>
Co-authored-by: Yongqi Zhuo <[email protected]>
Co-authored-by: yukuai26 <[email protected]>
Co-authored-by: Zhean Xu <[email protected]>

* Update FP8 epilogues and paged sparse MQA alignment (deepseek-ai#471)

Add FP8CastWithClamp with optional clamped-element counts, consolidate
GEMM epilogue conversions, and accept 128-byte paged sparse KV strides.
Keep the Mega MoE localizer alive until test teardown and bump the
package version to 2.8.2.

Co-authored-by: xyf007 <[email protected]>
Co-authored-by: yukuai26 <[email protected]>
Co-authored-by: Zhean Xu <[email protected]>

* Fix mega_mhc split barriers under CUDA graph replay (deepseek-ai#478)

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 (deepseek-ai#525)

* Public release 26/11/26

* Add 2026.11.26 News entry for deepseek-ai#525

---------

Signed-off-by: lightseek-bot <[email protected]>
Co-authored-by: Chenggang Zhao <[email protected]>
Co-authored-by: Anyi Xu <[email protected]>
Co-authored-by: huahuaquq <[email protected]>
Co-authored-by: TwenTy_ <[email protected]>
Co-authored-by: xyf007 <[email protected]>
Co-authored-by: Yongqi Zhuo <[email protected]>
Co-authored-by: yukuai26 <[email protected]>
Co-authored-by: Zhean Xu <[email protected]>
Co-authored-by: LightSeek Foundation <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
zcnrex added a commit to sgl-project/DeepGEMM that referenced this pull request Nov 28, 2026
Merge deepseek-ai/DeepGEMM main (public release 26/11/26, deepseek-ai#525) into dev
aryatsc pushed a commit to aryatsc/DeepGEMM that referenced this pull request Nov 28, 2026
…#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]>
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).
lightseek-bot pushed a commit to lightseekorg/tokenspeed that referenced this pull request Nov 30, 2026
## Summary

Bump `tokenspeed-deepgemm` from `2.8.2.post20261115` to
`2.9.4.post20261126` in `tokenspeed-kernel`. The upstream release
updates three paths used by TokenSpeed. [DeepGEMM 2.9.4 release
notes](deepseek-ai/DeepGEMM#525)

- **MegaMoE inference** batches token transfers during dispatch, reduces
atomic traffic, and uses streaming stores during combine. It also
supports optional fused RMSNorm after combine.
- **GEMM** tunes L2 tile ordering and TMA store stage selection. The
release also adds `[1, N]` bias support for BF16 and FP8/FP4 GEMMs and
an FP8 stochastic-rounding epilogue.
- **Shifted Mega mHC** selects normalization partitions on the host,
speeds up BF16 conversion and `exp`, and removes the split barriers’
dependency on grid IDs during CUDA graph replay.

The packaged build preserves FP32 reduction for Blackwell dense and
paged MQA when the caller supplies FP32 head weights. It also fixes
Hopper JIT compilation of the shared `fast_exp_ftz` helper.

Keep this PR in draft until the target wheels are available on both
[PyPI](https://pypi.org/project/tokenspeed-deepgemm/) and the [LightSeek
CUDA 12.9 wheel
index](https://lightseek.org/whl/cu129/tokenspeed-deepgemm/).

## Test Plan

- [ ] Verify that clean CUDA 13 and CUDA 12.9 installs resolve
`tokenspeed-deepgemm==2.9.4.post20261126` from their respective indexes.
- [ ] Run a Hopper GEMM with the published CUDA 12.9 wheel and a cold
JIT cache to exercise SM90 compilation.
- [ ] Run the Blackwell FP8 GEMM, dense and paged MQA, shifted Mega mHC,
and MegaMoE CUDA graph replay tests with the published CUDA 13 wheel.
- [ ] Verify that supported MegaMoE serving configurations satisfy the
new capacity limit of `num_experts × align_up(max_tokens_per_rank, 1920)
≤ 33,554,432`.

Signed-off-by: chenht2022 <[email protected]>
murphymatt pushed a commit to fw-ai-external/DeepGEMM that referenced this pull request Nov 30, 2026
Route explicit max_seqlen_k=0 through the fork dense shape instead of the positive-only deepseek-ai#525 branch, keep compressed test capacity equal to the largest row span, and add overload and indexed SM100 paged coverage. Clarify the intentional dense and paged calling differences in the serving MQA docs.
murphymatt pushed a commit to fw-ai-external/DeepGEMM that referenced this pull request Dec 1, 2026
test_mega_gate_config_query asserted num_gate_warpgroups <= 4, but the launch
heuristic (kept from deepseek-ai#525) balances the TMEM transpose and top-k rounds up to
kNumMaxGateWarpgroups = 7: at most 7 gate warpgroups fit the 1024-thread CTA
beside the 4 non-epilogue warps (128 + 7 * 128 == 1024), and the kernel's
blockDim is kNumNonEpilogueThreads + num_gate_threads.

On a 148-SM B300 the 8192-token shape balances to 14 transpose units and reports
7 warpgroups, so the helper was failing against a bound the kernel never had.
Assert the real contract instead.
zcnrex added a commit to sgl-project/DeepGEMM that referenced this pull request Dec 2, 2026
zcnrex added a commit to sgl-project/DeepGEMM that referenced this pull request Dec 2, 2026
…e dispatch, partial-row loads, batched pull, RMSNorm/FP32 out) (#179)

* [SM100] Mega MoE: barrier-free dispatch (port of upstream deepseek-ai#525)

Drop the dispatch grid sync and the NVLink barrier before the pull. The last
SM to arrive publishes the expert counts (per-rank counts, a system fence,
then the sums), source slots hold token_topk_idx + 1 and are polled per slot
and cleared in the cleanup, and combine / broadcast readiness become counters
that each launch decrements and the peer increments, so graph replays need no
reset. The scheduler acquires the expert-count sums.

Unlike upstream, SMs still skip the send-count atomic for experts they send no
tokens to; one arrival counter replaces upstream's per-expert arrival bits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* [SM100] Mega MoE: balanced expert blocks and partial-row activation loads (port of upstream deepseek-ai#525)

Spread an expert's tokens evenly over its M blocks in 16-row steps (BLOCK_M >= 32),
so its last block is no longer a short tail, and count each block's padding at
its own last token. Routed L1/L2 activation loads use tensor maps sized to the
block's UMMA-aligned valid rows, so short blocks skip the padding rows. Shared
blocks keep full-row loads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* [SM100] Mega MoE: advance a short L1 tail past the L1-first cap (port of upstream deepseek-ai#525)

Upstream advances up to kNumScheduleStages + 1 L1 waves when the remaining L1
work is within kNumScheduleStages waves of the warmup. Dev's L1-first rule
(#157) already covers most of that range; keep upstream's rule only where
L1-first does not apply.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* [SM100] Mega MoE: batch whole-token TMA pulls (port of upstream deepseek-ai#525)

When a token fits one pull chunk, the TMA pull keeps one token per lane and
pulls a batch of them with one transaction: every token's load, then the
weight, x_scale and SF loads, then one wait and every token's store. Batch
sizes follow upstream's table (2 tokens at 2 KiB, 4 at 1 KiB, ...), not for the
SIMT pull, the one-shot full-pool pull or BF16. DG_MEGA_MOE_PULL_TOKENS
overrides the batch size.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* [SM100] Mega MoE: fused post-combine RMSNorm and FP32 output (port of upstream deepseek-ai#525)

`fp8_fp4_mega_moe` takes `rms_weights` (in `y`'s dtype) and `rms_eps` to apply
an RMSNorm to the combined output, and `y` may be FP32. The norm is computed
in FP32, over the BF16-rounded output when `y` is BF16; a two-chunk token keeps
both chunks in adjacent warps of one CTA and exchanges the partial sums through
shared memory. FP32 `y` is stored directly from registers; BF16 keeps the TMA
store and the broadcast path (FP32 does not support `broadcast_y`).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* [SM100] Mega MoE: keep fences off the barrier-free dispatch count path

Each per-rank count now carries an arrival word, which the pull and the
cleanup wait for, so the last SM pushes counts and sums without a system
fence, the arrival is one acq_rel atomic instead of a fence plus an atomic,
and the scheduler polls the sums relaxed again. Only the fused post-expert
norm keeps an acq_rel system fence on both sides, for its zeroed sums.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* [SM100] Mega MoE: load send counts before the last SM's remote count pushes

Each expert's send-count load sat behind the previous expert's remote store in the publish loop.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* [SM100] Mega MoE: drop balanced expert blocks, keep partial-row activation loads

Measured on SM107 EP4: balanced blocks cost 1.6% at 4096 NVFP4 tokens per rank and 0.3-0.7% elsewhere; the partial-row loads alone are a 1.2-1.6% win.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* [SM100] Mega MoE: make the batched TMA pull opt-in

On B300 NVFP4 hidden 4096 the batched pull was 2-3% slower at EP4 decode
(T 1-512, every ABBA block), flat at EP4 prefill, and 1.8% faster only at
EP8 T=4096. DG_MEGA_MOE_PULL_TOKENS still enables it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* [SM100] Mega MoE: fix batched pull ring-wrap deadlock, rms_weights checks, and add RMSNorm/FP32 test

* [SM100] Mega MoE: coalesce recv counts, parallelize slot cleanup, and port scheduler tail-drain fixes

* [SM100] Mega MoE: port faster SwiGLU PTX primitives from upstream deepseek-ai#525

* [SM100] Mega MoE: streaming direct global stores for combine and SMEM-cached RMSNorm weights

* [SM100] Mega MoE: fetch expert recv counts before epilogue barrier to prevent 0-token cleanup race

* [SM100] Mega MoE: cap pull tokens by SMEM, check shared SymmBuffer slot extent, and acquire on per-expert count poll

* [SM100] Mega MoE: honor mainloop min_stages in pull-token cap and drop stale BF16 comment

* [SM100] Mega MoE: drop dead wait_result_store and use kNumChunkSlots in kPostNormInCombine check

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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