Skip to content

vulkan: warptiles currently assume warp sizes <= 64, clamp to work around larger warps - #27726

Merged
ggerganov merged 1 commit into
masterfrom
0cc4m/vulkan-warptile-clamp-64
Aug 26, 2026
Merged

vulkan: warptiles currently assume warp sizes <= 64, clamp to work around larger warps#27726
ggerganov merged 1 commit into
masterfrom
0cc4m/vulkan-warptile-clamp-64

Conversation

@0cc4m

@0cc4m 0cc4m commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Overview

Fixes #25734, supersedes #25735 which missed a few clamps. Long term, Adreno-compatible tiles could be added once #25773 is done.

Requirements

@0cc4m
0cc4m requested a review from a team as a code owner August 26, 2026 03:42
@github-actions github-actions Bot added Vulkan Issues specific to the Vulkan backend ggml changes relating to the ggml tensor library for machine learning labels Aug 26, 2026
const uint32_t subgroup_size_32 = std::max(device->subgroup_size, 32u);

// clamp WARP for l_/m_ warptiles so WM <= BM (breaks on subgroupSize > 64)
const uint32_t mm_warp_8 = std::min(subgroup_size_8, 64u);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never fully understood these tile size calculations. Would this work for a coopmat implementation with subgroupSize==128?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With coopmat it may be problematic, but currently the tile sizes are just incompatible generally with subgroups > 64. It was all created for subgroup size 32/64 on Nvidia and AMD.

@0cc4m 0cc4m added the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Aug 26, 2026
@ggerganov
ggerganov merged commit 5e6a37c into master Aug 26, 2026
27 of 30 checks passed
@ggerganov
ggerganov deleted the 0cc4m/vulkan-warptile-clamp-64 branch August 26, 2026 16:02
ppenatra pushed a commit to ppenatra/llama.cpp that referenced this pull request Aug 27, 2026
ilmmatias pushed a commit to ilmmatias/llama.cpp that referenced this pull request Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. Vulkan Issues specific to the Vulkan backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vulkan: wrong matmul results on Adreno (subgroupSize=128) — warptile WM exceeds BM (implicit WM <= BM invariant violated for subgroupSize > 64)

3 participants