Skip to content

fix: avoid f16 overflow in Z-Image quantized matmuls on ROCm#1771

Merged
leejet merged 1 commit into
leejet:masterfrom
pwilkin:zimage-rocm-prec-f32
Jul 10, 2026
Merged

fix: avoid f16 overflow in Z-Image quantized matmuls on ROCm#1771
leejet merged 1 commit into
leejet:masterfrom
pwilkin:zimage-rocm-prec-f32

Conversation

@pwilkin

@pwilkin pwilkin commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Fixes white image generation on ROCm backend by forcing 32-bit precision.

I don't know how many other image engines are affected, but might be worth a look.

Z-Image DiT activations exceed the f16 range (up to ~1e6) in the
attention qkv/out and feed_forward w2 projections. On HIP for RDNA3.x,
ggml routes large-batch quantized matmuls to the hipBLAS path, which
converts activations to f16, saturating them to inf; RMS_NORM then turns
the inf into NaN and the decoded image comes out blank. Force f32
precision on those three projections so they take the f32 GEMM path,
matching the existing Vulkan handling of w2.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@leejet leejet merged commit 9beb6ac into leejet:master Jul 10, 2026
11 checks passed
@leejet

leejet commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Thank you for your contribution.

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