diff --git a/vllm/nvfp4_cutedsl.py b/vllm/nvfp4_cutedsl.py index 3d73cad5..e39cf8d4 100644 --- a/vllm/nvfp4_cutedsl.py +++ b/vllm/nvfp4_cutedsl.py @@ -138,10 +138,9 @@ class CuTeDSLMoERunner: self.max_num_tokens * self.top_k, device=self.device ) - # Padded hidden/activated: per-layer, sized for max capture budget - # NOT sized for max_num_tokens (8192) which would be too much for 60 layers - max_slots = self.max_num_tokens * self.top_k - padded_max_slots = ((max_slots + 127) // 128) * 128 + # Padded hidden/activated: sized for num_experts * max_chunks * 128 (the actual padded size) + max_rows_per_expert = self._max_chunks_per_expert * 128 + padded_max_slots = self.num_experts * max_rows_per_expert self._padded_hidden_buf = torch.zeros( padded_max_slots, self.hidden_size, dtype=torch.bfloat16, device=self.device )