From 2123aca87e0f486d7843e50c5dd6928409bd9bb1 Mon Sep 17 00:00:00 2001 From: Aurick Qiao Date: Mon, 14 Sep 2026 06:04:28 -0700 Subject: [PATCH] [Fix] Wait for PDL before reading DeepSeek V4 K cache locations (#38409) Co-authored-by: Aurick Qiao <6137920+aurickq@users.noreply.github.com> --- python/sglang/kernels/jit/csrc/deepseek_v4/main_norm_rope.cuh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/sglang/kernels/jit/csrc/deepseek_v4/main_norm_rope.cuh b/python/sglang/kernels/jit/csrc/deepseek_v4/main_norm_rope.cuh index fd1226bc6..483d6fe1c 100644 --- a/python/sglang/kernels/jit/csrc/deepseek_v4/main_norm_rope.cuh +++ b/python/sglang/kernels/jit/csrc/deepseek_v4/main_norm_rope.cuh @@ -280,10 +280,10 @@ K_KERNEL void fused_k_norm_rope_flashmla(const __grid_constant__ FusedKNormRopeF const auto input_ptr = static_cast(params.kv) + work_id * params.kv_stride_batch; const auto position = static_cast(static_cast(params.positions)[work_id]); - const auto out_loc = params.out_loc[work_id]; const auto freqs_cis = params.freqs_cis + position * kRopeDim; PDLWaitPrimary(); + const auto out_loc = params.out_loc[work_id]; Float2 data, freq; // part 1: norm. Each thread owns one 2-elem pack (the `tx`-th).