CUDA: use block reductions for whole-row pool_1d (#31855)

* CUDA: use block reductions for whole-row pool_1d

Assisted-by: Claude Code

* CUDA: template pool1d row kernel by ggml_op_pool
This commit is contained in:
Giorgio Sarno authored and GitHub committed 2026-11-17 15:51:15 +01:00
1 parent 8b8ca4c98e
commit ebc9fb933e
3 files changed
+46

No files matched your search

+9
View File
@@ -10920,6 +10920,11 @@ static std::vector<std::unique_ptr<test_case>> make_test_cases_eval() {
}
}
}
// one window over the whole row (a row reduction)
for (int64_t iw : {10, 128, 256, 1000, 2048, 4099}) {
test_cases.emplace_back(new test_pool1d(pool_type, type_input, { iw, 3, 2, 1 }, (int) iw, (int) iw, 0));
test_cases.emplace_back(new test_pool1d(pool_type, type_input, { iw, 1024, 1, 1 }, (int) iw, (int) iw, 0));
}
}
}
@@ -13652,6 +13657,10 @@ static std::vector<std::unique_ptr<test_case>> make_test_cases_perf() {
}
}
}
// POOL_1D whole-row reduction with short rows and many rows
for (ggml_op_pool pool_type : {GGML_OP_POOL_AVG, GGML_OP_POOL_MAX}) {
test_cases.emplace_back(new test_pool1d(pool_type, GGML_TYPE_F32, {16, 65536, 1, 1}, 16, 16, 0));
}
// LEAKY_RELU at FFN activation width, for direct comparison with RELU
for (int64_t n_tokens : {512, 2048}) {