Skip to content

ggml: support concat for scalar types at cuda backend#24011

Merged
ggerganov merged 3 commits into
ggml-org:masterfrom
zihaomu:candidate1-concat-non-f32
Jun 12, 2026
Merged

ggml: support concat for scalar types at cuda backend#24011
ggerganov merged 3 commits into
ggml-org:masterfrom
zihaomu:candidate1-concat-non-f32

Conversation

@zihaomu

@zihaomu zihaomu commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Overview

Make CUDA CONCAT support common non-quantized scalar tensor types, not just F32.

What changed:

The CUDA CONCAT kernel now works for same-type, non-quantized scalar tensors with 1, 2, 4, or 8 byte elements.

Supported examples:

F16, BF16, I8, I16, I32, I64, and F32.

Not included:

Quantized tensor types are still excluded.

Tests:

Added backend CONCAT test coverage for F16, BF16, I8, I16, and I64.

@zihaomu zihaomu requested review from a team and ggerganov as code owners June 2, 2026 07:38
@zihaomu zihaomu changed the title Cuda: support concat for scalar types ggml: support concat for scalar types at cuda backend Jun 2, 2026
@github-actions github-actions Bot added testing Everything test related Nvidia GPU Issues specific to Nvidia GPUs ggml changes relating to the ggml tensor library for machine learning labels Jun 2, 2026
Comment thread ggml/src/ggml-cuda/concat.cu Outdated
@zihaomu

zihaomu commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Hi @ggerganov, just a friendly ping on this PR when you have time.
Would appreciate a review whenever convenient. Thanks!

@zihaomu zihaomu requested a review from a team as a code owner June 11, 2026 05:00
@github-actions github-actions Bot added the Apple Metal https://en.wikipedia.org/wiki/Metal_(API) label Jun 11, 2026
@zihaomu zihaomu force-pushed the candidate1-concat-non-f32 branch from 0ff784c to f697a07 Compare June 11, 2026 05:05
return src0_type == src1_type &&
src0_type == op->type &&
(src0_type == GGML_TYPE_F32 || src0_type == GGML_TYPE_I32);
}

@zihaomu zihaomu Jun 11, 2026

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.

Metal concat kernel only supports float-sized data type.

fairydreaming pushed a commit to fairydreaming/llama.cpp that referenced this pull request Jun 11, 2026
@fairydreaming fairydreaming mentioned this pull request Jun 11, 2026
4 tasks
@am17an am17an added the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Jun 11, 2026
@zihaomu zihaomu force-pushed the candidate1-concat-non-f32 branch from f697a07 to c96a285 Compare June 12, 2026 04:31
@zihaomu

zihaomu commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Update: Fixed the Objective-C compilation error, and this patch should pass CI now.

@ggerganov ggerganov merged commit 85f99dc into ggml-org:master Jun 12, 2026
37 checks passed
anaisbetts pushed a commit to anaisbetts/llama.cpp that referenced this pull request Jun 16, 2026
* cuda: support concat for scalar types

* Update concat.cu

* fix metal ci issue

(cherry picked from commit 85f99dc)
adrianhoehne pushed a commit to adrianhoehne/llama.cpp that referenced this pull request Jul 5, 2026
* cuda: support concat for scalar types

* Update concat.cu

* fix metal ci issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Apple Metal https://en.wikipedia.org/wiki/Metal_(API) 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. Nvidia GPU Issues specific to Nvidia GPUs testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants