llama.cpp
CUDA: Factor out and re-use `block_reduce` function
#18785
Merged

CUDA: Factor out and re-use `block_reduce` function #18785

ORippler
ORippler CUDA: Refactor and expose two_stage_warp_reduce_* function
418fb728
ORippler Use `two_stage_warp_reduce` also in softmax kernel, move smem out of it
1ebe58d8
github-actions github-actions added Nvidia GPU
github-actions github-actions added ggml
am17an
am17an commented on 2026-01-12
ORippler Update ggml/src/ggml-cuda/common.cuh
c63c148f
ORippler Use two_stage_warp_reduce in group_norm_f32
41bab53c
ORippler Use two_stage_warp_reduce in rms_norm_f32
a40b15fa
ORippler Fix smem calculation which expects bytes
dbd449e0
ORippler Make `two_stage_warp_reduce` accept all values warp_reduce accepts
7f43e648
ORippler Use two_stage_warp_reduce in l2_norm_f32
67a9c139
ORippler Use type traits for block reduction for better legibility
612874fc
ORippler Make norm tests cover all cuda paths
82a3458b
ORippler Mark columns % WARP_SIZE !=0 as supported for RMS_NORM_BACK
8bc326a5
ORippler Use `enum class` for `block_reduce_method`
bd6ffff4
ORippler Rename variables as suggested in code review by @am17an
c1a048bf
ORippler ORippler requested a review from ggerganov ggerganov 193 days ago
ORippler Rename two_stage_warp_reduce -> block_reduce
767eba93
ORippler
ORippler ORippler changed the title CUDA: Factor out and re-use `two_stage_warp_reduce` function CUDA: Factor out and re-use `block_reduce` function 193 days ago
am17an
am17an approved these changes on 2026-01-13
JohannesGaessler
JohannesGaessler approved these changes on 2026-01-13
github-actions github-actions added testing
ORippler Fix trailing whitespace in common.cuh
0ed37212
ORippler Make condition of static_assert type-dependent
b275e42e
ORippler Inline definitions
38e3040e
am17an am17an merged 36f01324 into master 192 days ago
ORippler ORippler deleted the osimons/factor_out_two_stage_warp_reductions branch 134 days ago

Login to write a write a comment.

Login via GitHub

Assignees
No one assigned
Labels
Milestone