@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / ce9dc02c93
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 15, 06:00 UTC

[Refactor] Remove unused variables in `moe_permute_unpermute_kernel.inl` (#19573)

Signed-off-by: yewentao256 <zhyanwentao@126.com>

Wentao Ye committed Jun 13, 2025 at 09:12 UTC ce9dc02c93eee4c9d96b51515e0048ca36ec908b
1 file changed -5
csrc/moe/permute_unpermute_kernels/moe_permute_unpermute_kernel.inl
-5
@@ -20,7 +20,6 @@ __global__ void expandInputRowsKernel(
20 int expert_id = sorted_experts[expanded_dest_row];
21
22 extern __shared__ int64_t smem_expert_first_token_offset[];
23 - int64_t align_expanded_row_accumulate = 0;
23 if constexpr (ALIGN_BLOCK_SIZE) {
24 // load g2s
25 for (int idx = threadIdx.x; idx < num_local_experts + 1;
@@ -63,7 +62,6 @@ __global__ void expandInputRowsKernel(
62 using DataElem = cutlass::Array<T, ELEM_PER_THREAD>;
63
64 // Duplicate and permute rows
66 - int64_t const source_k_rank = expanded_source_row / num_rows;
65 int64_t const source_row = expanded_source_row % num_rows;
66
67 auto const* source_row_ptr =
@@ -160,7 +158,6 @@ __global__ void finalizeMoeRoutingKernel(
158 elem_index += stride) {
159 ComputeElem thread_output;
160 thread_output.fill(0);
163 - float row_rescale{0.f};
161 for (int k_idx = 0; k_idx < k; ++k_idx) {
162 int64_t const expanded_original_row = original_row + k_idx * num_rows;
163 int64_t const expanded_permuted_row =
@@ -177,8 +174,6 @@ __global__ void finalizeMoeRoutingKernel(
174 auto const* expanded_permuted_rows_row_ptr =
175 expanded_permuted_rows_v + expanded_permuted_row * num_elems_in_col;
176
180 - int64_t const expert_idx = expert_for_source_row[k_offset];
181 -
177 ComputeElem expert_result = arrayConvert<InputElem, ComputeElem>(
178 expanded_permuted_rows_row_ptr[elem_index]);
179 thread_output = thread_output + row_scale * (expert_result);