Skip to content

CUDA: fix sm_70 tile compilation error - #29224

Merged
ggerganov merged 1 commit into
ggml-org:masterfrom
lingyezhixing:fix-sm70-ldmatrix
Sep 21, 2026
Merged

ggerganov merged 1 commit into
ggml-org:masterfrom
lingyezhixing:fix-sm70-ldmatrix

Conversation

@lingyezhixing

Copy link
Copy Markdown
Contributor

Overview

Fixes #29222.

The 5-argument load_ldmatrix added in 1884824 only defined tile<16, 8>, so the Volta tile<8, 4> used by sm_70 had no matching overload and fattn.cu failed to compile.

This PR generalizes the 5-argument load_ldmatrix tile shape from <16, 8> to <I, J>. The non-swizzle branch forwards to the 3-argument loader, so any tile shape works. The swizzle branch is restricted to <16, 8> with newly added static_assert(I == 16) / static_assert(J == 8).

This follows the existing pattern of load_ldmatrix_trans in the same file, which is already shape-generic plus static_assert(I == 16).

Only sm70 was affected; other architectures were checked. CI does not build sm70, so this was not caught.

Local compile and test passed.

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES — Used DeepSeek V4.1 Flash (OpenCode) for code assistance. I have manually reviewed and fully understand every line of the submitted code.

The 5-argument load_ldmatrix added in 1884824 only defines tile<16,8>, so the Volta tile<8,4> does not match. See ggml-org#29222 for details. Building on 1884824, generalize the tile shape of the 5-argument load_ldmatrix from <16,8> to <I,J>, so the non-swizzle branch forwards to the 3-argument loader for any shape. Local compilation and testing passed.

Assisted-by: DeepSeek V4.1 Flash (OpenCode)
@lingyezhixing
lingyezhixing requested a review from a team as a code owner September 21, 2026 13:19
@github-actions github-actions Bot added ggml changes relating to the ggml tensor library for machine learning CUDA Related to the CUDA backend labels Sep 21, 2026
@ggml-gh-bot

ggml-gh-bot Bot commented Sep 21, 2026

Copy link
Copy Markdown

Hi @lingyezhixing, thanks for your contribution!

Per our contribution guidelines, the automated PR checker found the following issue(s) that need your attention:

  • AI-generated content: While code is allowed to be generated by AI, please write the PR description and commit messages on your own without the help of AI.

Please note that maintainers reserve the right to make final decisions on PRs. If you believe there is a mistake, please comment below.

@lingyezhixing

Copy link
Copy Markdown
Contributor Author

@ggml-bot AI assisted me with troubleshooting and code changes, but the issue, PR description, and PR commit were written by me. My native language is not English, so I used AI for translation.

@ggerganov
ggerganov merged commit b1c2863 into ggml-org:master Sep 21, 2026
10 checks passed
@BrewTestBot BrewTestBot mentioned this pull request Sep 23, 2026
1 task done
LadislavSopko pushed a commit to 0ics-srls/llama.cpp that referenced this pull request Oct 5, 2026
The 5-argument load_ldmatrix added in 3de51d3 only defines tile<16,8>, so the Volta tile<8,4> does not match. See ggml-org#29222 for details. Building on 3de51d3, generalize the tile shape of the 5-argument load_ldmatrix from <16,8> to <I,J>, so the non-swizzle branch forwards to the 3-argument loader for any shape. Local compilation and testing passed.

Assisted-by: DeepSeek V4.1 Flash (OpenCode)
edwardyoon pushed a commit to edwardyoon/focus-llama that referenced this pull request Oct 7, 2026
The 5-argument load_ldmatrix added in 1884824 only defines tile<16,8>, so the Volta tile<8,4> does not match. See ggml-org#29222 for details. Building on 1884824, generalize the tile shape of the 5-argument load_ldmatrix from <16,8> to <I,J>, so the non-swizzle branch forwards to the 3-argument loader for any shape. Local compilation and testing passed.

Assisted-by: DeepSeek V4.1 Flash (OpenCode)
(cherry picked from commit b1c2863)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CUDA Related to the CUDA backend ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compile bug: Cant build current git 6f41ac59e0a49a00483a316a22ada6b04edd2950 Compile bug: Build error with sm_70 on Windows 11

3 participants