{"record":{"id":"31bf3f31ba22d76a","repo":"huggingface/transformers","slug":"deepgemm-experts-dispatch-does-not-support-static","errorCode":null,"errorMessage":"DeepGEMM experts dispatch does not support static activation quantization.","messagePattern":"DeepGEMM experts dispatch does not support static activation quantization\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"src/transformers/integrations/deepgemm.py","lineNumber":708,"sourceCode":"    top_k_index: torch.Tensor,\n    top_k_weights: torch.Tensor,\n) -> torch.Tensor:\n    if self._deepgemm_disabled:\n        # Set at load when the model spans >1 CUDA device in this process, where DeepGEMM's\n        # context-bound kernels corrupt across devices (see `quantizer_finegrained_fp8.py`).\n        raise RuntimeError(\n            \"DeepGEMM experts selected on a model spanning multiple CUDA devices in one process; \"\n            \"its kernels are bound to a single CUDA context and corrupt across devices. Use \"\n            \"`experts_implementation='grouped_mm'`, or run one device per process (TP/EP).\"\n        )\n\n    # Fail before the (hub-download + JIT) load if this device can't serve these dtypes.\n    _assert_sm100_requirements(self.down_proj, self.down_proj_scale_inv)\n\n    deepgemm = load_deepgemm_kernel()\n\n    if self.activation_scheme == \"static\":\n        raise NotImplementedError(\"DeepGEMM experts dispatch does not support static activation quantization.\")\n    if hidden_states.dtype != torch.bfloat16:\n        raise ValueError(f\"DeepGEMM experts path requires bfloat16 hidden states, got {hidden_states.dtype}\")\n    grouped_fp8_fp4_matmul = (\n        deepgemm.grouped_fp8_fp4_matmul_nn if self.is_transposed else deepgemm.grouped_fp8_fp4_matmul_nt\n    )\n\n    device = hidden_states.device\n    num_top_k = top_k_index.size(-1)\n    num_tokens = hidden_states.size(0)\n    hidden_dim = hidden_states.size(-1)\n\n    weight_up = to_local(self.gate_up_proj if self.has_gate else self.up_proj)\n    weight_scale_up = to_local(self.gate_up_proj_scale_inv if self.has_gate else self.up_proj_scale_inv)\n    weight_down = to_local(self.down_proj)\n    weight_scale_down = to_local(self.down_proj_scale_inv)\n\n    cast_kwargs = _select_fp8_cast_kwargs(weight_up, weight_scale_up, self.block_size, is_sm100())\n    (","sourceCodeStart":690,"sourceCodeEnd":726,"githubUrl":"https://github.com/huggingface/transformers/blob/a597f974857b3d92939971296bc0deb93d33d780/src/transformers/integrations/deepgemm.py#L690-L726","documentation":"Error \"DeepGEMM experts dispatch does not support static activation quantization.\" thrown in huggingface/transformers.","triggerScenarios":"Raised in DeepGEMM expert dispatch when activation_scheme is 'static'.","commonSituations":"Static activation quantization configured for a MoE model using DeepGEMM expert dispatch.","solutions":["Use dynamic activation quantization for DeepGEMM experts dispatch.","Choose another experts dispatch that supports static quantization."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a597f974857b3d92939971296bc0deb93d33d780","analyzedAt":"2026-08-14T18:24:08.354Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}