From 455ecb563151473efbe485b6d16a6cfb41c16cad Mon Sep 17 00:00:00 2001 From: biondizzle Date: Sun, 17 May 2026 15:47:38 +0000 Subject: [PATCH] Fix: define padded_max_slots before using it in shared buffer allocation --- vllm/nvfp4_cutedsl.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vllm/nvfp4_cutedsl.py b/vllm/nvfp4_cutedsl.py index 5e234263..a57dc111 100644 --- a/vllm/nvfp4_cutedsl.py +++ b/vllm/nvfp4_cutedsl.py @@ -145,6 +145,8 @@ class CuTeDSLMoERunner: # Padded hidden/activated: SHARED across all runners (not per-layer) # These are only used during run() which is sequential across layers. # Per-layer allocation would be 72 MB × 60 layers = 4.3 GB → OOM. + max_rows_per_expert = self._max_chunks_per_expert * 128 + padded_max_slots = self.num_experts * max_rows_per_expert device_key = str(self.device) if not hasattr(CuTeDSLMoERunner, '_shared_padded_bufs'): CuTeDSLMoERunner._shared_padded_bufs = {}