llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.92k stars 11.52k forks source link

[mlir][spirv] Audit numerical correctness of conversions to SPIR-V #73459

Open kuhar opened 9 months ago

kuhar commented 9 months ago

The detailed FP semantics of SPIR-V ops is often decoupled from the op specification. For example, OpGroupNonUniForm "FMin" does not specify how +/- 0.0 and NaN values are handled. The exact FP numerical precision requirements are outlined in https://registry.khronos.org/vulkan/specs/1.3-extensions/html/chap52.html#spirvenv-precision-operation and may change depending on execution modes ro fast math flags.

We should audit the conversions to the SPIR-V dialect for floating point precision semantics (e.g., {arith, vector, gpu}-to-spirv), identify the gaps, and resolve them. This is tracking issue for this umbrella of work.

llvmbot commented 9 months ago

@llvm/issue-subscribers-mlir-spirv

Author: Jakub Kuderski (kuhar)

The detailed FP semantics of SPIR-V ops is often decoupled from the op specification. For example, [`OpGroupNonUniForm "FMin"`](https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#OpGroupNonUniformFMin) does not specify how +/- 0.0 and NaN values are handled. The exact FP numerical precision requirements are outlined in https://registry.khronos.org/vulkan/specs/1.3-extensions/html/chap52.html#spirvenv-precision-operation and may change depending on execution modes ro fast math flags. We should audit the conversions to the SPIR-V dialect for floating point precision semantics (e.g., {arith, vector, gpu}-to-spirv), identify the gaps, and resolve them. This is tracking issue for this umbrella of work.
Sh0g0-1758 commented 5 months ago

Hey @kuhar, I can take this up. Can you give me some pointers to get started.