Skip to content

Extend HIP batched F32 matmul and IM2COL kernels - #1150

Merged
0xShug0 merged 1 commit into
mainfrom
perf/hip-batched-f32-im2col
Oct 31, 2026
Merged

0xShug0 merged 1 commit into
mainfrom
perf/hip-batched-f32-im2col

Conversation

@0xShug0

@0xShug0 0xShug0 commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Extend the opt-in gfx1151_v1 HIP implementation with equal-sized batched F32 matrix multiplication and improved 1D IM2COL indexing and workload admission.

  • Batched F32 multiplication reuses the existing FP32 arithmetic, supports independent batch strides, and retains the existing minimum dimensions and work/tile thresholds. Single-matrix and typed-matmul paths are preserved.
  • IM2COL reuses GGML's fast integer division helper and admits work according to the device's compute-unit count instead of fixed size quotas. Address calculations remain 64-bit.
  • The diff contains the two kernels, the IM2COL callback argument needed for device capacity, and focused cases in the existing GGML test suite. No RMS fusion, copy changes, model changes, or framework changes.

CUDA and default HIP execution are unchanged. The kernels run only when gfx1151_v1 is selected.

Validation

AMD Radeon 8060S (gfx1151), ROCm 7.2.1, Debug C++17 build with -O2, eight CPU threads. Published Q8 packages were downloaded directly from pinned Hugging Face revisions and checked against their recorded hashes.

The comparison uses the same PR binary: default HIP versus gfx1151_v1, in serial A–B–B–A order. Each session has a warmup, a short request, a long request, and a repeated short request, with seed 1234 and identical settings on both sides. English inputs are 108/661 characters; Irodori's Japanese inputs are 74/249 characters. Warmup is excluded; RTF is total measured request time divided by total generated audio duration.

Model, Q8 PR default HIP RTF PR gfx1151_v1 RTF RTF change
Irodori-TTS Small MF 0.3374 0.0774 77.1% lower
BreezeTTS2 1.0020 0.8654 13.6% lower
Ming3-TTS-0.5B 0.4500 0.4513 0.3% higher; within run variation
OmniVoice 0.7575 0.4872 35.7% lower
Qwen3-TTS 1.7B VoiceDesign 0.5344 0.3673 31.3% lower

These numbers measure the full selected implementation against default HIP, not the incremental gain of this patch over the implementation already on main.

  • GGML gfx1151_v1 correctness suite: 149/149 pass on default HIP and 149/149 pass on gfx1151_v1, compared against the CPU reference. This includes batched/strided F32 multiplication, precision guards, native fallback controls, and partial-tile IM2COL cases.
  • All 20 model sessions passed. All short-repeat PCM comparisons within each session were byte-identical; cross-implementation output lengths and sample rates matched.
  • BreezeTTS2, Qwen3-TTS and Irodori measured WAV cosine similarity was above 0.99999; Ming3 outputs were byte-identical. OmniVoice's short output exceeded 0.99999, but its long output differed substantially (cosine 0.0336). This run does not establish speech-quality parity for that long output.

AMD validation run

@0xShug0
0xShug0 merged commit 3a0dd44 into main Oct 31, 2026
7 checks passed
@0xShug0
0xShug0 deleted the perf/hip-batched-f32-im2col branch October 31, 2026 22:33
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.

1 participant