make fp8 skip check only valid for linux

This commit is contained in:
Disty0
2026-07-12 15:37:18 +03:00
parent 03473c1316
commit 16c82c58af
2 changed files with 9 additions and 3 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
# pylint: disable=redefined-builtin,no-member,protected-access
import os
import sys
import json
import torch
@@ -359,7 +360,7 @@ else:
is_fp8_mm_supported = os.environ.get("SDNQ_ALLOW_FP8_MM", "0").lower() not in {"0", "false", "no"}
if os.environ.get("SDNQ_ALLOW_FP8_COMPILE", None) is None:
if devices.backend == "cuda":
if devices.backend == "cuda" and "linux" in sys.platform:
is_fp8_compile_supported = bool(torch.cuda.get_device_capability(devices.device) >= (8,9)) # triton has no e4m3 conversions before sm_89
else:
is_fp8_compile_supported = True
+7 -2
View File
@@ -276,10 +276,14 @@ class SDNQDequantizer:
self.use_stochastic_rounding = use_stochastic_rounding
self.use_hadamard = use_hadamard
self.layer_class_name = layer_class_name
self.num_bits = dtype_dict[weights_dtype]["num_bits"]
self.is_packed = dtype_dict[weights_dtype]["is_packed"]
self.is_unsigned = dtype_dict[weights_dtype]["is_unsigned"]
self.is_integer = dtype_dict[weights_dtype]["is_integer"]
self.is_unsigned = dtype_dict[weights_dtype]["is_unsigned"]
self.num_bits_matmul = dtype_dict[quantized_matmul_dtype]["num_bits"]
self.is_packed_matmul = dtype_dict[quantized_matmul_dtype]["is_packed"]
self.is_integer_matmul = dtype_dict[quantized_matmul_dtype]["is_integer"]
self.is_unsigned_matmul = dtype_dict[quantized_matmul_dtype]["is_unsigned"]
@devices.inference_context()
def re_quantize_matmul(
@@ -291,10 +295,11 @@ class SDNQDequantizer:
svd_down: torch.FloatTensor | None = None,
hadamard: torch.FloatTensor | None = None,
non_hadamard: bool = True,
skip_compile: bool = False,
) -> tuple[torch.Tensor, torch.FloatTensor]: # pylint: disable=unused-argument
if hadamard is None and self.use_hadamard and not non_hadamard:
hadamard = get_hadamard(self.hadamard_group_size, dtype=self.result_dtype, device=weight.device)
re_quantize_matmul_func = re_quantize_matmul if skip_fp8_compile(self.weights_dtype) else re_quantize_matmul_compiled
re_quantize_matmul_func = re_quantize_matmul if skip_compile or skip_fp8_compile(self.weights_dtype) else re_quantize_matmul_compiled
return re_quantize_matmul_func(
self.weights_dtype,
weight,