Skip to content

model : fix k-pool indexer softmax gridDim.y overflow - #2

Open
AIalliAI wants to merge 2 commits into
GLM5.3-Flashfrom
fix/glm5-kpool-softmax-grid-y
Open

model : fix k-pool indexer softmax gridDim.y overflow#2
AIalliAI wants to merge 2 commits into
GLM5.3-Flashfrom
fix/glm5-kpool-softmax-grid-y

Conversation

@AIalliAI

@AIalliAI AIalliAI commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Overview

Reshape k-pool gate logits before ggml_soft_max so n_new does not map to gridDim.y, which is capped at 65535 on CUDA. During k-pool indexer prefill at n_kv >= 262144, the gate softmax is shaped [kpool, head_dim, n_new] and trips the launch at kpool = 4.

Reshape to [kpool, head_dim * n_new] before softmax, reshape back after. Same pattern as the comment in qwen4exp.cpp.

Stacked on GLM5.3-Flash (ggml-org#27773 path).

Additional information

Also open on timkhronos#11.

Related: ggml-org#27754, unslothai#214

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES - assisted implementation and review; I understand the change and can maintain it.

Reshape the k-pool gate logits before softmax so n_new does not map to
gridDim.y, which is capped at 65535 on CUDA. Fixes prompt processing
abort at n_kv >= 262144 reported in ggml-org#27773.

Assisted-by: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant