vulkan: Use native e2m1 and e4m3 conversions for mxfp4/nvfp4 (#25338)

This uses the new VK_EXT_shader_ocp_microscaling_types extension to do fp4 type
promotions, and also uses the float8 extension to do ue4m3 promotions for
nvfp4. It's reasonable to assume that an implementation that supports fp4 will
also support fp8, so we don't need to handle all possible combinations of
support.
This commit is contained in:
Jeff Bolz
2026-07-13 08:44:17 -05:00
committed by GitHub
parent 259ae1df8b
commit e920c523e3
10 changed files with 344 additions and 63 deletions
+12
View File
@@ -97,6 +97,18 @@ if (Vulkan_FOUND)
"GGML_VULKAN_BFLOAT16_GLSLC_SUPPORT"
)
test_shader_extension_support(
"GL_EXT_float_e2m1"
"${CMAKE_CURRENT_SOURCE_DIR}/vulkan-shaders/feature-tests/float_e2m1.comp"
"GGML_VULKAN_FLOAT_E2M1_GLSLC_SUPPORT"
)
test_shader_extension_support(
"GL_EXT_float_e4m3"
"${CMAKE_CURRENT_SOURCE_DIR}/vulkan-shaders/feature-tests/float_e4m3.comp"
"GGML_VULKAN_FLOAT_E4M3_GLSLC_SUPPORT"
)
target_link_libraries(ggml-vulkan PRIVATE Vulkan::Vulkan)
target_include_directories(ggml-vulkan PRIVATE ${CMAKE_CURRENT_BINARY_DIR})