Fix: define padded_max_slots before using it in shared buffer allocation

This commit is contained in:
2026-05-17 15:47:38 +00:00
parent b1ac74bb4d
commit 455ecb5631

View File

@@ -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 = {}