A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 11, 15:00 UTC
[CI/Build][AMD] Fix ref_dynamic_per_token_quant reference implementation on ROCm. (#30291)
Signed-off-by: Randall Smith <ransmith@amd.com> Co-authored-by: Randall Smith <ransmith@amd.com>
rasmith committed
Dec 12, 2025 at 03:30 UTC
302b2c1eb968711abe3e765f7a936dea66535907
1 file changed
+4
-9
tests/kernels/quant_utils.py
+4
-9
@@ -30,16 +30,11 @@ def ref_dynamic_per_token_quant(
30
if quant_dtype == torch.int8
31
else torch.finfo(quant_dtype)
32
)
33
- qtype_traits_max = (
34
- ROCM_FP8FNUZ_MAX
35
- if current_platform.is_rocm() and current_platform.is_fp8_fnuz()
36
- else qtype_traits.max
37
- )
38
- qtype_traits_min = (
39
- -ROCM_FP8FNUZ_MAX
40
- if current_platform.is_rocm() and current_platform.is_fp8_fnuz()
41
- else qtype_traits.min
33
+ use_fp8fnuz = (
34
+ current_platform.is_fp8_fnuz() and quant_dtype == current_platform.fp8_dtype()
35
)
36
+ qtype_traits_max = ROCM_FP8FNUZ_MAX if use_fp8fnuz else qtype_traits.max
37
+ qtype_traits_min = -ROCM_FP8FNUZ_MAX if use_fp8fnuz else qtype_traits.min
38
qtype_max = as_float32_tensor(qtype_traits_max)
39
s_1 = as_float32_tensor(1.0)
40
s_512 = as_float32_tensor(512.0)