8000 Enable 16-bit storage together with shader_float16 by kvark · Pull Request #406 · kvark/blade · GitHub
[go: up one dir, main page]

Skip to content

Enable 16-bit storage together with shader_float16 - #406

Merged
kvark merged 1 commit into
mainfrom
claude/nvidia-prime-investigation-wUmwH
Oct 9, 2026
Merged

kvark merged 1 commit into
mainfrom
claude/nvidia-prime-investigation-wUmwH

Conversation

@kvark
@kvark kvark commented Oct 9, 2026
Copy link
Copy Markdown
Owner

Split out of #405: the f16 part, which is the functional change MI300X needs.

Problem

Naga's SPIR-V backend declares StorageBuffer16BitAccess and UniformAndStorageBuffer16BitAccess for every f16 type. The Vulkan backend enabled shaderFloat16 whenever the device had it, but enabled the 16-bit storage features only when cooperative matrix reported f16 shapes. A device with shaderFloat16 and no f16 cooperative matrix (MI300X on RADV, lavapipe) therefore got shaders that declare features that were never enabled.

Change

  • shader_float16 is reported only when storageBuffer16BitAccess and uniformAndStorageBuffer16BitAccess are also supported.
  • Device creation enables both storage features whenever shader_float16 is on.
  • f16_f32_shapes keys off the same flag, so the "auto-enable shader_float16 from cooperative matrix" line is redundant and removed.

The crash-marker barrier and the MI300 examples and scripts in #405 are left out.

Testing

I ran a scratch compute test on lavapipe with validation on: it reads array<f16> from a storage buffer and writes f32. Lavapipe reports shader_float16=true and no f16 cooperative matrix shapes, which is the MI300X case.

  • On main, pipeline creation reports VUID-VkShaderModuleCreateInfo-pCode-08740, once each for StorageBuffer16BitAccess and UniformAndStorageBuffer16BitAccess, plus VUID-RuntimeSpirv-storageBuffer16BitAccess-06331. Lavapipe still produces the right output.
  • On this branch there are no validation messages and the output is correct.

I haven't run it on MI300X hardware.

🤖 Generated with Claude Code

https://claude.ai/code/session_01W9jSvpnbXEXmoHFuUVFdUN


Generated by Claude Code

Naga declares StorageBuffer16BitAccess and UniformAndStorageBuffer16BitAccess
for any f16 type, but the Vulkan backend enabled the matching device
features only when cooperative matrix reported f16 shapes. Devices with
shaderFloat16 and no f16 cooperative matrix (MI300X on RADV, lavapipe) got
f16 shaders declaring features that were never enabled.

Report shader_float16 only when both 16-bit storage features are present,
and enable them whenever shader_float16 is. The cooperative matrix f16
shapes now key off the same flag, so the old auto-enable is redundant.

Taken from the MI300 experiments in #405.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W9jSvpnbXEXmoHFuUVFdUN
@kvark
kvark enabled auto-merge (rebase) October 9, 2026 02:44
@kvark
kvark merged commit 56f0565 into main Oct 9, 2026
12 checks passed
@kvark
kvark deleted the claude/nvidia-prime-investigation-wUmwH branch October 9, 2026 02:48
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.

2 participants

0