Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
aadb953
Add the glm_moe_dsa modeling_v2 family with its sm107 tp16 target layout
dongfengy Oct 15, 2026
0cf150f
Pad the token-sparse MLA Q tile to 8 rows
dongfengy Oct 15, 2026
48bab5f
Keep the dense MLP at the full TP when the post-MLP all-reduce is fused
dongfengy Oct 15, 2026
6bedb70
Assemble the GLM-5.2 tp16 target on the built-in modules
dongfengy Oct 15, 2026
41a8b93
Cover the glm_moe_dsa tp16 route in the routing tests
dongfengy Oct 15, 2026
e8989ff
Write the GLM-5.2 tp16 decode step out layer by layer
dongfengy Oct 15, 2026
0045428
Add the GLM-5.2 TP16 small-M dense MLP op
dongfengy Oct 15, 2026
ff3f54a
Add the GLM-5.2 one-kernel BF16 embedding lookup op
dongfengy Oct 15, 2026
4cac427
Run the GLM-5.2 decode step's embedding and dense MLPs on the GLM ops
dongfengy Oct 15, 2026
712dddb
Add the GLM-5 fused-A GEMM as the glm_fused_a_gemm op
dongfengy Oct 15, 2026
c78339d
Add the GLM-5 router GEMV as the glm_router_gemm op
dongfengy Oct 15, 2026
f5f79e6
Run the GLM-5.2 decode step's attention as target code with the fused…
dongfengy Oct 15, 2026
4da71b5
Add the glm_moe_dsa tp16 target's low-M split-K GEMM ops
dongfengy Oct 15, 2026
44d3f27
Let the TRTLLM-Gen NVFP4 MoE op wait for its input right before FC1
dongfengy Oct 15, 2026
712292c
Compute the router GEMV inside the TRTLLM-Gen MoE routing kernel on r…
dongfengy Oct 15, 2026
7ef4ef6
Add a K = 128 FC2 kernel to the TRTLLM-Gen NVFP4 MoE
dongfengy Oct 15, 2026
84f8e7e
Add the GLM-5.2 tp16 routed-experts entry
dongfengy Oct 15, 2026
bf6f559
Run the GLM-5.2 decode step's MoE blocks on the routed-experts and sp…
dongfengy Oct 15, 2026
14a26ac
Add the GLM-5.2 tp16 target's fused MLA KV-half append op
dongfengy Oct 15, 2026
da28d08
Add the GLM-5.2 tp16 target's sparse MLA flash-decode op
dongfengy Oct 15, 2026
0910c8d
Run the GLM-5.2 decode step's attention core on the q_b, KV-half and …
dongfengy Oct 15, 2026
d21070f
Add the GLM-5.2 low-M BF16 MoE op for the one-token MTP experts
dongfengy Oct 15, 2026
a32608f
Add the GLM-5.2 fused verify acceptance op with the forced count
dongfengy Oct 15, 2026
80634f6
Add the GLM-5.2 MTP step-0 row selection as one Triton launch
dongfengy Oct 15, 2026
35b6fe1
Add the GLM-5.2 MTP draft-step input glue as one CuTe DSL kernel
dongfengy Oct 15, 2026
45a93c3
Add the GLM-5.2 MTP draft-step kernels after the draft LM head
dongfengy Oct 15, 2026
4be90c5
Add the glm_moe_dsa tp16 target's MNNVL one-shot hops
dongfengy Oct 15, 2026
d854d2a
Add the glm_moe_dsa tp16 target's MNNVL logits all-gather
dongfengy Oct 15, 2026
3c67cff
Run the GLM-5.2 decode step's all-reduces as MNNVL hops with the publ…
dongfengy Oct 15, 2026
27fd45a
Add the GLM key-sharded DSA indexer top-k with an MNNVL histogram exc…
dongfengy Oct 15, 2026
cdd392b
Add the GLM fused DSA indexer prologue as target-local Triton
dongfengy Oct 15, 2026
4cc8374
Add the GLM FP8 paged MQA logits with the full-query and early-KV ker…
dongfengy Oct 15, 2026
acbb0e8
Add the GLM MTP index-share stash and reused-TopK remap entries
dongfengy Oct 15, 2026
d8fdb58
Run the GLM-5.2 decode step's DSA indexer on this rank's key shard
dongfengy Oct 15, 2026
bfa7142
Compute the GLM-5.2 verify logits on the split-K LM head and the MNNV…
dongfengy Oct 15, 2026
5c403eb
Build DeepGEMM's JIT kernels for the 10.0 family target on 10.x devic…
dongfengy Oct 15, 2026
b3b4c2d
Fix the GLM-5.2 tp16 op tests that the first sm_107 run flagged, and …
dongfengy Oct 16, 2026
f34af65
Detach the tensors the GLM split-K GEMMs hand to CuTe DSL
dongfengy Oct 16, 2026
bc0a935
Check and fold the GLM-5.2 decode target's attention weights per layer
dongfengy Oct 16, 2026
e79fce2
Run the GLM-5.2 MTP draft loop on the decode target's kernels
dongfengy Oct 16, 2026
2daccc6
Build the GLM-5.2 tp16 targets without autograd
dongfengy Oct 16, 2026
2e6cc69
Start the GLM-5.2 tp16 dsa and draft-step test ranks on the imported …
dongfengy Oct 16, 2026
84581f6
Allow one BF16 rounding step in the GLM-5.2 draft RMSNorm output bands
dongfengy Oct 16, 2026
79574e9
Apply main's pre-commit formatting to the GLM-5.2 tp16 target, its op…
dongfengy Oct 16, 2026
dd8b358
[None][fix] GLM-5.2 tp16 decode: read the KV pool from the step's cac…
dongfengy Oct 16, 2026
cb024ee
[None][feat] GLM-5.2 tp16 draft loop: drop the per-step DSA metadata …
dongfengy Oct 16, 2026
5556e16
[None][feat] Refresh the kv-length metadata once per step under the o…
dongfengy Oct 16, 2026
a51b5d3
[None][feat] GLM-5.2 tp16 draft worker: accept draft tokens in one ke…
dongfengy Oct 16, 2026
360bc22
[None][feat] GLM-5.2 tp16 decode: q_b beside the top-k, early KV gath…
dongfengy Oct 16, 2026
23791cb
[None][feat] Leave the DSA decode metadata of a speculative decode gr…
dongfengy Oct 16, 2026
606312b
[None][feat] Skip unchanged or unread uploads in the speculative step…
dongfengy Oct 16, 2026
8a8378b
[None][feat] Bound the speculative KV page-table copy and skip unchan…
dongfengy Oct 16, 2026
3ee542d
[None][feat] Upload the per-request Philox state only for rejection s…
dongfengy Oct 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion 3rdparty/fetch_content.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@
"git_tag": "b64107f2b9599ca76445b7f62eedf66bae1d095b",
"git_submodules_recurse": true,
"source_subdir": "dont-add-this-project-with-add-subdirectory",
"patch_file": "patches/deepgemm_configurable_barrier_timeout.patch"
"patch_file": [
"patches/deepgemm_configurable_barrier_timeout.patch",
"patches/deepgemm_sm10x_family_target.patch"
]
},
{
"name": "eigen",
Expand Down
13 changes: 13 additions & 0 deletions 3rdparty/patches/deepgemm_sm10x_family_target.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- a/csrc/runtime/jit.hpp
+++ b/csrc/runtime/jit.hpp
@@ -37,6 +37,10 @@
// Preserve the existing 12.x family target when DeepJIT derives a different minor target.
if (runtime->device.get_arch_major() == 12 and runtime->device.get_arch_minor() != 0)
runtime->default_compiler_options.arch = "120f";
+ // A 10.x device past 10.3 (e.g. 10.7) builds for the 10.0 family target, which it runs:
+ // the bundled CUTLASS enables TMA and tcgen05 only for the targets it knows.
+ if (runtime->device.get_arch_major() == 10 and runtime->device.get_arch_minor() > 3)
+ runtime->default_compiler_options.arch = "100f";
return runtime;
});
}
28 changes: 20 additions & 8 deletions cpp/tensorrt_llm/batch_manager/kvCacheManagerV2Utils.cu
Original file line number Diff line number Diff line change
Expand Up @@ -184,19 +184,20 @@ CUresult copyDeviceToDevice(std::vector<MMTask> const& tasks, ssize_t numBytes,
return launchBatchedCopy(false, tasks, numBytes, stream);
}

// dst_tensor[:, :num_seqs, 0] = src_tensor[:, copy_idx]
// dst_tensor[:, :num_seqs, 1] = dst_tensor[:, :num_seqs, 0] + 1
// dst_tensor[:, :num_seqs, 0, :numBlocksToCopy] = src_tensor[:, copy_idx, 0, :numBlocksToCopy]
// dst_tensor[:, :num_seqs, 1, :numBlocksToCopy] = dst_tensor[:, :num_seqs, 0, :numBlocksToCopy] + 1
// Rows are numBlocksPerSeq long in both tensors; the columns past numBlocksToCopy are not written.
__global__ void copyBatchBlockOffsetsToDeviceKernel(SizeType32 const* __restrict__ srcPtr,
SizeType32* __restrict__ dstPtr, SizeType32 const srcMaxNumSequences, SizeType32 const dstMaxNumSequences,
SizeType32 numBlocksPerSeq, SizeType32 const* __restrict__ copyIndex, SizeType32 const* __restrict__ indexScales,
SizeType32 const* __restrict__ kvOffset)
SizeType32 numBlocksPerSeq, SizeType32 numBlocksToCopy, SizeType32 const* __restrict__ copyIndex,
SizeType32 const* __restrict__ indexScales, SizeType32 const* __restrict__ kvOffset)
{
constexpr uint32_t kvFactor = 2;
constexpr auto elemPerAccess = sizeof(PackedInt) / sizeof(SizeType32);

__shared__ PackedInt data[copyBlocknbBufs][copyBlockCtaSize];

auto const iterPerSeq = divUp(numBlocksPerSeq * sizeof(SizeType32), sizeof(PackedInt) * copyBlockCtaSize);
auto const iterPerSeq = divUp(numBlocksToCopy * sizeof(SizeType32), sizeof(PackedInt) * copyBlockCtaSize);
auto const tid = threadIdx.x;
auto const poolIdx = blockIdx.x;
auto const seqIdx = blockIdx.y;
Expand All @@ -205,7 +206,7 @@ __global__ void copyBatchBlockOffsetsToDeviceKernel(SizeType32 const* __restrict
uint32_t const dstIdxKBeg = tid * elemPerAccess + (poolIdx * dstMaxNumSequences + seqIdx) * seqDimStride;
uint32_t const dstIdxVBeg = dstIdxKBeg + numBlocksPerSeq;

uint32_t const srcIdxEnd = (poolIdx * srcMaxNumSequences + copyIndex[seqIdx]) * seqDimStride + numBlocksPerSeq;
uint32_t const srcIdxEnd = (poolIdx * srcMaxNumSequences + copyIndex[seqIdx]) * seqDimStride + numBlocksToCopy;

for (uint32_t i = 0; i < iterPerSeq + copyBlocknbBufs; i++)
{
Expand Down Expand Up @@ -250,7 +251,7 @@ __global__ void copyBatchBlockOffsetsToDeviceKernel(SizeType32 const* __restrict

// Host-side launcher
void copyBatchBlockOffsetsToDevice(ITensor const& input, ITensor& output, ITensor const& copyIndex,
ITensor const& indexScales, ITensor const& kvOffset, CUstream stream) noexcept
ITensor const& indexScales, ITensor const& kvOffset, SizeType32 maxNumBlocks, CUstream stream) noexcept
{
using namespace tensorrt_llm::runtime;

Expand Down Expand Up @@ -282,11 +283,22 @@ void copyBatchBlockOffsetsToDevice(ITensor const& input, ITensor& output, ITenso
"Not implemented case: numBlocksPerSeq * sizeof(SizeType32) = %zu must be a multiple of %zu.",
static_cast<size_t>(numBlocksPerSeq * sizeof(SizeType32)), static_cast<size_t>(sizeof(PackedInt)));

// A negative maxNumBlocks copies whole rows. Otherwise the copy covers the first maxNumBlocks
// columns, rounded up to whole PackedInt accesses, which stay inside the row.
SizeType32 numBlocksToCopy = numBlocksPerSeq;
if (maxNumBlocks >= 0)
{
constexpr SizeType32 blocksPerAccess = sizeof(PackedInt) / sizeof(SizeType32);
SizeType32 const roundedBlocks
= (std::max(maxNumBlocks, SizeType32{1}) + blocksPerAccess - 1) / blocksPerAccess * blocksPerAccess;
numBlocksToCopy = std::min(numBlocksPerSeq, roundedBlocks);
}

dim3 gridDim(numPools, numSeqs, 1);
dim3 blockDim(copyBlockCtaSize);

copyBatchBlockOffsetsToDeviceKernel<<<gridDim, blockDim, 0, stream>>>(srcPtr, dstPtr, srcMaxNumSequences,
dstMaxNumSequences, numBlocksPerSeq, copyIndexPtr, indexScalesPtr, kvOffsetPtr);
dstMaxNumSequences, numBlocksPerSeq, numBlocksToCopy, copyIndexPtr, indexScalesPtr, kvOffsetPtr);
}

} // namespace tensorrt_llm::batch_manager::kv_cache_manager_v2
4 changes: 3 additions & 1 deletion cpp/tensorrt_llm/batch_manager/kvCacheManagerV2Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ CUresult copyHostToDevice(std::vector<Task<MemAddress, MemAddress>> const& tasks
CUresult copyDeviceToHost(std::vector<Task<MemAddress, MemAddress>> const& tasks, ssize_t numBytes, CUstream stream);
CUresult copyDeviceToDevice(std::vector<Task<MemAddress, MemAddress>> const& tasks, ssize_t numBytes, CUstream stream);

//! Copies the block offsets of the batch rows. A non-negative maxNumBlocks bounds the copied columns
//! (rounded up to a multiple of four); a negative one copies whole rows.
void copyBatchBlockOffsetsToDevice(ITensor const& input, ITensor& output, ITensor const& copyIndex,
ITensor const& indexScales, ITensor const& kvOffset, CUstream stream) noexcept;
ITensor const& indexScales, ITensor const& kvOffset, SizeType32 maxNumBlocks, CUstream stream) noexcept;

} // namespace tensorrt_llm::batch_manager::kv_cache_manager_v2
Loading