Repository navigation
Public release 26/09/30 - #462
Merged
Merged
Conversation
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: Chenggang Zhao <[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]>
17 of 56 tasks
|
Ое |
This was referenced Oct 3, 2026
Heisenberg-Yin
added a commit
to Heisenberg-Yin/DeepGEMM
that referenced
this pull request
Oct 9, 2026
…stograms, next-n 1..6 Port the BF16 paged MQA producer of deepseek-ai#462 (merge 057ca59: MXFP4 Q/KV, BF16 head weights, BF16 head reduction and BF16 logits) as an isolated `mqa_bf16` kernel with its own split-384 cost-balanced schedule, and let it emit the same coarse histogram as the FP32 path. - APIs: `get_paged_mqa_logits_bf16_metadata(context_lens, 128, num_sms, indices=, tokens_per_request=)` and `fp4_paged_mqa_logits_bf16(..., indices=, histogram=, tokens_per_request=)` (pybind, TVM-FFI, deep_gemm / sgl_deep_gemm). - Adjacent equal request IDs share KV loads; the CPU hint selects Q4 / 3 TMEM stages (1..4) or Q6 / 2 stages (5..6; 6 also XOR-swizzles the histogram). Q4 keeps deepseek-ai#462's static TMEM stage mapping (its no-histogram kernel is SASS-identical to deepseek-ai#462); Q6 rotates a two-stage TMEM ring. - Exact histogram: every live non-NaN stored BF16 score counted once per row (16-bit shared counters for a window of rows, packed fast path for 2^-14 <= |x| < 16, published with packed 64-bit global atomics). The histogram kernels' scheduler caps a task's splits so the 16-bit overflow guard runs once per task; Q6 counts a 12-row window with 6 KV stages, so a CTA moving to the next request does not publish mid-kernel. Logits are bit-identical with and without the histogram. - Shared with the FP32 path: the coarse-bin encoding (epilogue/ coarse_histogram.cuh, plus a BF16 overload) and NoHistogram; dev's packing, ring pipeline (new parity-phase option for steps longer than a 2-stage ring), math / PTX / UMMA descriptor helpers. Only the kernel core, its shared-memory layout, its scheduler and the histogram accumulator are BF16-specific. - Test: sgl_deep_gemm/tests/test_mqa_bf16.py (n = 1..6, PDL off / on, exact counts, accumulation, CUDA-graph replay with changing lengths and request IDs). Replaces sgl-project#96.
zyongye
added a commit
to zyongye/DeepGEMM
that referenced
this pull request
Oct 10, 2026
Bring in locality-aware Mega MoE, the GEMM epilogue classes with BF16 stochastic rounding, the reworked Lightning/Sparse Indexer kernels, and upstream's MQA API changes. Adapt the new upstream APIs to the TORCH_LIBRARY bindings: - Epilogue classes are a `deep_gemm::Epilogue` custom class built by factory ops; `deep_gemm.epilogue.X(...)` returns one and every GEMM and einsum op takes it as `epilogue=None`. - Locality domain helpers are `locality_domain_*` ops, exposed as `deep_gemm._C.locality_domain` for `deep_gemm.locality_domain`. - MLOPart calls into Python through the CPython limited API instead of pybind11, taking the GIL itself. - `shutdown` is a config op. - Python errors from MLOPart surface as `RuntimeError` through the dispatcher, which `test_locality_domain` now accepts. Adopt upstream's MQA API: drop `fp8_mqa_logits`, `fp8_paged_mqa_logits`, `fp8_gemm_nt_skip_head_mid`, `clean_logits` and `logits_dtype`, and always return compressed logits. SM120 keeps its kernels unchanged: FP8 inputs with per-token float KV scales or MXFP4, FP32 weights and FP32 logits, fixed-length or varlen paged queries. SM90 keeps 32-row pages and next_n=4. Keep dev's other changes on top of upstream: - SM120 GEMMs move to `epilogue::operators` and lose the head-split index remap along with `fp8_gemm_nt_skip_head_mid`. - The SiTU Mega MoE variant is re-derived from upstream's kernel, and the NVFP4 Mega MoE uses the new scheduler with one locality domain. - SwiGLU alpha/beta is re-applied on top of upstream's prefetching epilogue. - Mega Gate keeps the removal of the finite-score device trap. - `get_bf16_mega_gate_config` is removed, following upstream. Co-Authored-By: Claude Opus 5.5 <[email protected]>
zyongye
added a commit
to vllm-project/DeepGEMM
that referenced
this pull request
Oct 10, 2026
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: 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: Claude Opus 5.5 <[email protected]>
6 tasks done
1 of 2 tasks
Heisenberg-Yin
added a commit
to Heisenberg-Yin/DeepGEMM
that referenced
this pull request
Oct 16, 2026
…stograms, next-n 1..6 Port the BF16 paged MQA producer of deepseek-ai#462 (merge 057ca59: MXFP4 Q/KV, BF16 head weights, BF16 head reduction and BF16 logits) as an isolated `mqa_bf16` kernel with its own split-384 cost-balanced schedule, and let it emit the same coarse histogram as the FP32 path. - APIs: `get_paged_mqa_logits_bf16_metadata(context_lens, 128, num_sms, indices=, tokens_per_request=)` and `fp4_paged_mqa_logits_bf16(..., indices=, histogram=, tokens_per_request=)`: TORCH_LIBRARY ops in csrc/torch_library_api.cpp (`Tensor(a!)? histogram`, no schema defaults), deep_gemm / sgl_deep_gemm wrappers that own the defaults, and pybind. - Adjacent equal request IDs share KV loads; the CPU hint selects Q4 / 3 TMEM stages (1..4) or Q6 / 2 stages (5..6; 6 also XOR-swizzles the histogram). Q4 keeps deepseek-ai#462's static TMEM stage mapping (its no-histogram kernel is SASS-identical to deepseek-ai#462); Q6 rotates a two-stage TMEM ring. Each stage count is the deepest ring that fits (TMEM columns, SM100 shared memory with the histogram window); split 384 and the 3 x 128 math threads are named `Config` constants. The schedule (one CTA, two int32 per row in shared memory) checks its documented limit of 16384 rows. - Exact histogram: every live non-NaN stored BF16 score counted once per row (16-bit shared counters for a window of rows, packed fast path for 2^-14 <= |x| < 16, published with packed 64-bit global atomics). The histogram kernels' scheduler caps a task's splits so the 16-bit overflow guard runs once per task; Q6 counts a 12-row window with 6 KV stages, so a CTA moving to the next request does not publish mid-kernel. Logits are bit-identical with and without the histogram. - Shared with the FP32 path: the coarse-bin encoding (epilogue/ coarse_histogram.cuh, plus a BF16 overload) and NoHistogram; dev's packing, ring pipeline (new parity-phase option for steps longer than a 2-stage ring), math / PTX / UMMA descriptor helpers. Only the kernel core, its shared-memory layout, its scheduler and the histogram accumulator are BF16-specific. - Test: sgl_deep_gemm/tests/test_mqa_bf16.py, a plain script that run_tests.sh runs on SM100 (n = 1..6, PDL off / on, exact counts, accumulation, CUDA-graph replay with changing lengths and request IDs; the schedule's row limit). Replaces sgl-project#96. Co-Authored-By: Claude Opus 5.5 <[email protected]>
zcnrex
added a commit
to sgl-project/DeepGEMM
that referenced
this pull request
Oct 16, 2026
…-ai#471) into dev Two-parent merge of upstream 1fc9c66 (deepseek-ai#441, deepseek-ai#462, deepseek-ai#471) into sgl dev b296ce3, keeping the SGL wheel, the TORCH_LIBRARY binding and the downstream kernels. - Mega MoE: upstream locality-domain scheduling, 4D weight TMA, L1/L2 store blocks and the TMEM prefetch epilogue, with NVFP4/MXFP4, TRT-LLM weights, alphas, SiTU and FP8 combine carried over. TRT weights stay unlocalized. - GEMM epilogue classes threaded through every dispatch; SM90/SM120 assert that no custom epilogue is set. SM120 kernels drop the head-split epilogue parameter, as upstream did for SM90. - Attention takes upstream's API as-is: no clean_logits/logits_dtype, no legacy fp8_mqa_logits/fp8_paged_mqa_logits, no fp8_gemm_nt_skip_head_mid. The SM120 MQA kernels that only served the old API are removed. - Mega gate is sqrtsoftplus-only; bf16_mega_gate defaults to it and get_bf16_mega_gate_config is gone. - TORCH_LIBRARY binding: epilogue classes (Identity, Alpha, FP8CastWithClamp, BF16StochasticRounding) cross as (kind, scalar, sfd, count) into every GEMM/einsum op; shutdown and the locality-domain ops are registered; MLOPart reaches Python through ctypes callbacks installed by deep_gemm/locality_domain.py, which re-raises the callback's exception from the allocating call. - sgl_deep_gemm tests pick up upstream's test changes and the new test_locality_domain.py. - Dev's per-expert post-norm (#104) sits on upstream's restructured epilogue and combine. Its store block of 48 at block_m 192 becomes the L1 store block, upstream's FP8xFP4 L1/L2 blocks at 240 are kept, and DG_MEGA_MOE_TILES sets both L1 and L2. - deep_jit stays at dev's 3732a3b, a descendant of upstream's 2efdab4. Co-Authored-By: Claude Opus 5.5 <[email protected]>
lucifer1004
added a commit
to lucifer1004/DeepGEMM-sm120
that referenced
this pull request
Nov 18, 2026
…0.2.0) Upstream 26/09/30 (deepseek-ai/DeepGEMM#462) replaced `epilogue/transform.cuh` with `epilogue/operators.cuh`, removed HeadSplits together with the head-splits API, and widened the shared sparse-MQA layout. - GEMM kernels take `EpilogueOperatorArgs` and construct an `epilogue::operators` operator (`Identity` or `ScaleByAlpha`); the N index of every store is the identity. - The split-K reduce keys its instantiation on the operator type only. - `layout/sparse_mqa_logits.cuh` is shared with SM100 and now comes from the base; the SM120 sparse kernel keeps its fixed 32-head layout (`kNumHeads = kNumMaxHeads`) and already clips partial tails per token. - Only symbols present in both the 26/09/30 and 10/14 (#471) operators are used: the compile gate passes against the synced nv_dev (main 5081f85 API) and vllm-project/DeepGEMM dev (26/09/30). - The manifest drops to 15 files; the allowlist, check_vendor, docs and CI comments follow. The nv_dev-lineage host-glue copies are refreshed from the synced nv_dev tree, and the drift watcher now tracks nv_dev and vllm-project dev instead of the merged PR branches. Breaking: forks must take upstream #462 and pass `EpilogueOperatorArgs` to the SM120 GEMM kernels (see host-glue/main-lineage/README.md). Co-Authored-By: Claude Opus 5.5 <[email protected]>
RayWang96
pushed a commit
that referenced
this pull request
Nov 19, 2026
* Public Release 26/09 (#432) * Public release 26/09 * Update News * Fix Mega MoE task info slot release ordering (#441) * Public release 26/09/30 (#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 (#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 (#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]> * Restore FP32 weights/logits in SM100 MQA logits (port of vllm-project#46) Upstream 26/09/30 made the SM100 dense and paged MQA logits kernels take BF16 weights and write BF16 logits only. nv_dev callers pass FP32 weights and read FP32 logits, so port vllm-project#46: the SM100 kernel is templated on the weights and logits types again, and the host accepts FP32 or BF16 weights on SM100 (MX inputs). `logits_dtype` now defaults to the weights' precision: BF16 weights reduce in BF16 and require (and default to) BF16 logits; FP32 and FP16 weights default to FP32 logits. This is the same default on every architecture. Non-MX FP8 inputs on SM100 still take the FP16-weight path only. Tests: test_nv_attention_restoration.py checks the SM100 unified dense kernel with MXFP8 inputs and FP32/BF16 weights, eager against scheduled, bitwise. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Pin the sparse MQA metadata layout in the SM120 kernel The SM120 sparse MQA kernel reads `layout/sparse_mqa_logits.cuh`, which is shared with SM100 and follows upstream. Assert the parts of it the kernel reads (struct sizes and field offsets, slot packing, KV split flag mask), so a future upstream format change fails to compile instead of producing wrong logits. The device file matches DeepGEMM-sm120 v0.2.0. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Drop stale clean_logits notes from the README The MQA logits APIs no longer take `clean_logits`. Also note that the SM100 FP16-weight path is the only non-MX FP8 MQA logits path on SM100. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Signed-off-by: lightseek-bot <[email protected]> Co-authored-by: Zhean Xu <[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: LightSeek Foundation <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
lucifer1004
added a commit
to lucifer1004/DeepGEMM
that referenced
this pull request
Nov 19, 2026
…deepseek-ai#441, deepseek-ai#462, deepseek-ai#471) as merged into nv_dev deepseek-ai#509 synced these upstream commits into nv_dev but was squash-merged, which kept their changes and dropped their ancestry. Without it the next upstream sync would see them as unmerged and re-apply them from an older merge base. This merge uses the 'ours' strategy: the tree is unchanged.
RayWang96
pushed a commit
that referenced
this pull request
Nov 19, 2026
…r CUDA graph replay) into nv_dev Brings deepseek-ai PRs #462 (057ca59, Public release 26/09/30), #471 (1fc9c66) and #478 (5081f85) onto nv_dev (b4c138c). Merge base is 78b6900. API follows upstream: * MQA logits: `clean_logits` is removed, `max_seqlen_k` is required, and the SM100 paged metadata is varlen-only. nv_dev keeps one extension: a `logits_dtype` keyword (FP32 or BF16, after `max_seqlen_k` / `max_context_len`). It defaults to BF16 on SM100 and FP32 on SM90/SM120. * The legacy `fp8_mqa_logits` / `fp8_paged_mqa_logits` wrappers and `fp8_gemm_nt_skip_head_mid` are removed, as upstream removed them. * GEMM/einsum epilogues take upstream's `EpilogueClass` objects. Conflict resolution highlights: * Epilogues: the SM120 BF16 and FP8/FP4 GEMM kernels move from `epilogue/transform.cuh` to the `epilogue/operators.cuh` operator API (`EpilogueOperatorArgs`, `Identity`); `HeadSplits` and `apply_index_n` are gone. The device files match DeepGEMM-sm120 v0.2.0. SM120 GEMMs reject custom epilogue classes; the SM120 BF16 einsum takes `C` and accepts only a plain BF16 store on its native path, checked before `D` is written. * MQA logits: adopt upstream's dense/paged/sparse host code while keeping nv_dev's SM120 dense, paged and sparse paths, the SM90 block_kv=32 and next_n=4 multicast, and the SM100 FP16-weight path. * Sparse MQA logits: follow upstream's `kNumMaxHeads` layout and the `kPartialTailFlag` bit in the KV split header. nv_dev keeps its metadata, device, alignment and weight-stride checks, the 16-byte paged KV stride (#459) and workspace reuse under graph capture (#459). * Mega MoE, mega_mhc, locality domain, layout and runtime: upstream. * README: upstream. docs/scaling-factor-format.md describes the new API. * Tests: SM120 tests move to the new API (no `clean_logits`, 0x3fffffff KV count mask, required `max_seqlen_k`) and add coverage for the plain FP8 GEMM store branches and the SM120 einsum `C` input. test_nv_attention_restoration.py no longer imports removed helpers. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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]>
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.
This update introduces new features, performance improvements, and important API changes:
New features
deep_gemm.epilogueclasses:Identity,Alpha,FP8Quantization, and opt-inBF16StochasticRoundingfor direct BF16 output on SM100.bhr,hdr->bhdandbhd,hdr->bhr.Performance improvements
Fixes
Breaking changes
fp8_fp4_mqa_logitsAPI now requires a positivemax_seqlen_kand returns compressed logits. The dense non-paged and paged MQA APIs no longer acceptclean_logitsorlogits_dtype; callers must mask entries beyond each row's valid KV span.indicesand usenext_n=1.fp8_mqa_logits,fp8_paged_mqa_logits, andfp8_gemm_nt_skip_head_midAPIs. Use thefp8_fp4_*mqa_logitsAPIs for MQA workloads.scoring_func="sqrtsoftplus", which is also the default.get_bf16_mega_gate_confighas been removed.Related release
Contributors