From 74944a5dbfb99dc67bebc80e026e2ba5e74b5d22 Mon Sep 17 00:00:00 2001 From: LeonxLJX <51880185+LeonxLJX@users.noreply.github.com> Date: Tue, 1 Sep 2026 14:51:00 +0800 Subject: [PATCH 1/2] fix(testing): add fp16 and float8_e5m2 to dtype_to_str mapping --- tile_kernels/testing/bench.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tile_kernels/testing/bench.py b/tile_kernels/testing/bench.py index 6ad099e..ba64f0c 100644 --- a/tile_kernels/testing/bench.py +++ b/tile_kernels/testing/bench.py @@ -59,13 +59,15 @@ def print_average_perf(latency_list: list[float], bandwidth_list: list[float], r def dtype_to_str(dtype: torch.dtype) -> str: mapping = { torch.float32: 'fp32', + torch.float16: 'fp16', torch.bfloat16: 'bf16', torch.float8_e4m3fn: 'e4m3', + torch.float8_e5m2: 'e5m2', torch.int8: 'e2m1', # int8 represents FP4 e2m1 format } if dtype not in mapping: - raise ValueError(f'Unsupported dtype: {dtype}. Only fp32, bf16, e4m3, and int8(e2m1) are supported') + raise ValueError(f'Unsupported dtype: {dtype}. Only fp32, fp16, bf16, e4m3, e5m2, and int8(e2m1) are supported') return mapping[dtype] From 90e89a9be018b1d8f6e625b949bea8dd3a1f7bea Mon Sep 17 00:00:00 2001 From: LeonxLJX <51880185+LeonxLJX@users.noreply.github.com> Date: Tue, 1 Sep 2026 15:23:41 +0800 Subject: [PATCH 2/2] refactor: generate supported-dtype list dynamically in error message (per ds-review-bot suggestion) --- tile_kernels/testing/bench.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tile_kernels/testing/bench.py b/tile_kernels/testing/bench.py index ba64f0c..fe25a25 100644 --- a/tile_kernels/testing/bench.py +++ b/tile_kernels/testing/bench.py @@ -67,7 +67,7 @@ def dtype_to_str(dtype: torch.dtype) -> str: } if dtype not in mapping: - raise ValueError(f'Unsupported dtype: {dtype}. Only fp32, fp16, bf16, e4m3, e5m2, and int8(e2m1) are supported') + raise ValueError(f'Unsupported dtype: {dtype}. Only {", ".join(mapping.values())} are supported') return mapping[dtype]