From 60d10f7103b47b8db779fe665b61acdd8212daf9 Mon Sep 17 00:00:00 2001 From: Fabian Peddinghaus Date: Thu, 15 Oct 2026 10:11:56 +0200 Subject: [PATCH] Support the FP6 dtypes added in onnx 1.23 onnx 1.23 adds FLOAT6E2M3 and FLOAT6E3M2, packed at 6 bits per element. Add them to ITEMBITS so the converter sizes them correctly and the dtype coverage test passes again on the wheel builds, which install the latest onnx rather than the locked one. --- src/python/omnimalloc/benchmark/converters/model.py | 2 ++ tests/unit/benchmark/converters/test_onnx.py | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/python/omnimalloc/benchmark/converters/model.py b/src/python/omnimalloc/benchmark/converters/model.py index 7bbbb7e..eee1f7d 100644 --- a/src/python/omnimalloc/benchmark/converters/model.py +++ b/src/python/omnimalloc/benchmark/converters/model.py @@ -16,6 +16,8 @@ "int4": 4, "uint4": 4, "float4_e2m1fn": 4, + "float6_e2m3fn": 6, + "float6_e3m2fn": 6, "bool": 8, "int8": 8, "uint8": 8, diff --git a/tests/unit/benchmark/converters/test_onnx.py b/tests/unit/benchmark/converters/test_onnx.py index 850fa12..f87bf31 100644 --- a/tests/unit/benchmark/converters/test_onnx.py +++ b/tests/unit/benchmark/converters/test_onnx.py @@ -70,7 +70,15 @@ def simple_onnx_model() -> "onnx.ModelProto": # The widths onnx.helper.make_tensor packs a raw tensor to, for the types numpy # has no storage for; every other type is one numpy itemsize per element. -SUB_BYTE_BITS = {"INT2": 2, "UINT2": 2, "INT4": 4, "UINT4": 4, "FLOAT4E2M1": 4} +SUB_BYTE_BITS = { + "INT2": 2, + "UINT2": 2, + "INT4": 4, + "UINT4": 4, + "FLOAT4E2M1": 4, + "FLOAT6E2M3": 6, + "FLOAT6E3M2": 6, +} def test_itembits_covers_every_onnx_dtype() -> None: