Skip to content

CUDA: fix crash on large batch size for quant. MoE#13537

Merged
JohannesGaessler merged 1 commit into
ggml-org:masterfrom
JohannesGaessler:cuda-fix-dsr1-max-batch
May 14, 2025
Merged

CUDA: fix crash on large batch size for quant. MoE#13537
JohannesGaessler merged 1 commit into
ggml-org:masterfrom
JohannesGaessler:cuda-fix-dsr1-max-batch

Conversation

@JohannesGaessler

Copy link
Copy Markdown
Contributor

Should fix issue described in #13435 (comment) .

This PR swaps the x and y dimensions of the CUDA grid for quantizing the activations since the x dimension has a higher maximum size.

@github-actions github-actions Bot added Nvidia GPU Issues specific to Nvidia GPUs ggml changes relating to the ggml tensor library for machine learning labels May 14, 2025
constexpr int vals_per_sum = ds_layout == MMQ_Q8_1_DS_LAYOUT_D2S6 ? 16 : 32;

const int64_t i0 = ((int64_t)blockDim.x*blockIdx.x + threadIdx.x)*4;
const int64_t i0 = ((int64_t)blockDim.x*blockIdx.y + threadIdx.x)*4;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

blockDim.y?

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.

blockDim refers to the maximum extents of threadIdx. The configuration of threads was not changed, therefore blockDim.x is still correct.

@jukofyork

Copy link
Copy Markdown
Collaborator

Please confirm whether #13537 fixes the issue.

Yeah, this fixed it for me - thanks!

@JohannesGaessler JohannesGaessler merged commit 4696d56 into ggml-org:master May 14, 2025
Silver267 pushed a commit to Silver267/llama.cpp that referenced this pull request May 14, 2025
Nexesenex added a commit to Nexesenex/croco.cpp that referenced this pull request May 16, 2025
Nexesenex added a commit to Nexesenex/croco.cpp that referenced this pull request Jul 26, 2025
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
phibya pushed a commit to ziee-ai/llama.cpp that referenced this pull request May 29, 2026
fewtarius pushed a commit to fewtarius/CachyLLama that referenced this pull request May 30, 2026
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
fukuro-kun pushed a commit to fukuro-kun/fukuro-llama-cpp-turboquant that referenced this pull request Jul 5, 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 Nvidia GPU Issues specific to Nvidia GPUs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants