diff --git a/patches/deepseek_v4.py b/patches/deepseek_v4.py index 23c51d3..50b8303 100644 --- a/patches/deepseek_v4.py +++ b/patches/deepseek_v4.py @@ -244,16 +244,16 @@ class DeepseekV4FP8Config(Fp8Config): return isinstance(layer, FusedMoE) and self.expert_dtype == "fp4" -@triton.jit +import triton +import triton.language as tl +import torch + """ NVFP4 staging kernel — full FP4 (E2M1) activations + UE4M3 block16 scales. The mxf4nvf4 PTX instruction requires BOTH A and B to be FP4 (E2M1 packed). This kernel quantizes BF16 activations → E2M1 packed uint8 with UE4M3 scales. """ -import triton -import triton.language as tl -import torch @triton.jit