Skip to content

vulkan: use double-precision rcp_d on AMD wave32 devices - #37

Merged
Vasyl-Trefilov merged 1 commit into
RustingStudio:mainfrom
ybenyedder:fix/amd-wave32-rcp-d
Nov 15, 2026
Merged

Vasyl-Trefilov merged 1 commit into
RustingStudio:mainfrom
ybenyedder:fix/amd-wave32-rcp-d

Conversation

@ybenyedder

Copy link
Copy Markdown

On main (b99db7d), quant_xq runs in wave32 on AMD RDNA (W64 == false), so rcp_d(a, b) falls back to fdiv(a, b) (a * (1.0 / b)). On AMD Radeon 890M (gfx1150, RADV Mesa 26.2.6), that rounding difference fails tests/kernels.rs (vulkan_type_matrix and gemv_partial_superblocks_and_q2_0) with gemm_dense / gemm relative errors around 1.2e-4 .. 1.5e-4.

This adds specialization constant 13 (RCP_D, set when vendor_id == 0x1002) so rcp_d uses double(a) / double(b) on AMD even in wave32, while keeping NVIDIA wave32 fdiv behavior completely untouched.

Tested on AMD Radeon 890M (gfx1150) with ./tools/gen_spirv.sh && cargo test --release --lib --bins --tests: all 19 test crates pass (including tests/kernels.rs: 31 passed, 0 failed, 4 ignored).

@Vasyl-Trefilov

Copy link
Copy Markdown
Member

ty again!

@Vasyl-Trefilov
Vasyl-Trefilov merged commit dbf4be7 into RustingStudio:main Nov 15, 2026
2 checks passed
Vasyl-Trefilov added a commit that referenced this pull request Nov 15, 2026
… drafters, Windows NVRTC lookup

- web UI: terminal-style redesign, message actions, sampler presets, export/import, load options, accent color by model family
- serve: batched decode and batched prefill of queued requests on dense CUDA models; cap of cached CUDA graphs
- serve suggests calibration; no queue limit by default (--max-waiting)
- EAGLE3 speculative decoding, n-gram drafters, --prompt-cache, RDNA3.5 Vulkan work (#36)
- cuda: NVRTC found by our own name list, so Windows finds a CUDA 12.x DLL (#35)
- vulkan: double-precision rcp_d on AMD wave32 devices (#37)
- TQ1_0 and TQ2_0 GGUF types
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