Skip to content

[CuTeDSL] Decode UE5M3 top binade as finite Float32 - #3617

Open
XFDG wants to merge 1 commit into
NVIDIA:mainfrom
XFDG:fix/ue5m3-decode-3602
Open

XFDG wants to merge 1 commit into
NVIDIA:mainfrom
XFDG:fix/ue5m3-decode-3602

Conversation

@XFDG

@XFDG XFDG commented Sep 13, 2026

Copy link
Copy Markdown

Summary

  • decode scalar FloatNV8E5M3FNU to Float32 from its UE5M3 bit representation instead of using IEEE E5M2 widening semantics
  • preserve finite values for the complete top exponent binade (codes 248-254)
  • preserve 0xff as the format's sole NaN encoding
  • add a 256-code CuTe DSL GPU regression test

Testing

  • NVIDIA B200 (SM100), CUDA 13.1, nvidia-cutlass-dsl 4.8.0.dev0
  • python -m pytest test_float_nv8e5m3fnu_conversion.py -q -rs (1 passed)
  • the test verifies codes 0-254 exactly against the UE5M3 definition and verifies code 255 is NaN
  • on the unpatched package with CUDA 13.1, the generic widening path fails NVVM compilation with unsupported operation; the patched bit-level lowering compiles and executes successfully
  • ruff format --check python/CuTeDSL/_mlir_helpers/arith.py test/python/CuTeDSL/test_float_nv8e5m3fnu_conversion.py
  • ruff check --ignore F403,F405 python/CuTeDSL/_mlir_helpers/arith.py test/python/CuTeDSL/test_float_nv8e5m3fnu_conversion.py (the ignored diagnostics are pre-existing wildcard-import diagnostics in arith.py)
  • git diff --check

Contribution disclosure

AI assistance was used for repository research, implementation, independent review, and running the checks above.

Fixes #3602

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] CuTe DSL: FloatNV8E5M3FNU.to(Float32) returns inf for the entire top exponent binade (codes 248-254)

2 participants