Repository navigation
[Bug Fix] GLM-5.1: drop constexpr on page_indice_batch_offset, skip offloader post_init on draft worker, support N=32 in copy_to_gpu_no_ce - #23550
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Triton kernel for NSA by removing the constexpr constraint on the page index batch offset, ensures the offloader is not post-initialized for draft workers in the model runner, and adds support for a block size of 32 in the CUDA copy kernel. I have no feedback to provide.
|
page_indice_batch_offset is dropped from tl.constexpr because its value is derived from page_indices.shape[1], which changes across batches in serving. Keeping it as a compile-time constant forces Triton to JIT-recompile the kernel for every new value and inflates the kernel cache, while the parameter is only used in a scalar multiply and a scalar compare — neither benefits from constexpr folding. Passing it as a runtime int yields a single kernel variant with no measurable overhead. |
|
/tag-and-rerun-ci |
…ffloader post_init on draft worker, support N=32 in copy_to_gpu_no_ce (sgl-project#23550)
Motivation
Several issues were blocking the GLM-5.1 expert-offload path and causing excessive Triton recompilation on long-sequence / per-batch runs. This PR bundles the minimal fixes required to unblock it.
Modifications
get_k_and_skernel: droptl.constexprfrompage_indice_batch_offsetand pass it as a regularint. Its value ispage_indices.shape[1], which varies at runtime (long seqlen / per-batch), so keeping it asconstexprforces a Triton JIT recompile for every new value.model_runner: skipget_offloader().post_init()on draft workers, so MTP does not re-initialize and fight with the target model's offloader state.sgl-kernelcopy.cu: add anN == 32case tocopy_to_gpu_no_ce, required by the GLM-5.1 expert-offload path (previously hitunexpected N).