From 81e4a907c0f640d2ddc8ef9359c26ac5f2ba2d2e Mon Sep 17 00:00:00 2001 From: dylanyunlon Date: Sat, 1 Aug 2026 02:08:31 +0800 Subject: [PATCH] [muh] add tuning_find_bound_sorted_values.cuh: BI-V100 tuning header for find_bound_sorted_values Translated from CCCL cub/device/dispatch/tuning/tuning_find_bound_sorted_values.cuh. Uses hardware_capability dispatch instead of compute_capability. --- .../tuning_find_bound_sorted_values.cuh | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 muh/include/muh/tuning/tuning_find_bound_sorted_values.cuh diff --git a/muh/include/muh/tuning/tuning_find_bound_sorted_values.cuh b/muh/include/muh/tuning/tuning_find_bound_sorted_values.cuh new file mode 100644 index 00000000..e57d0b6f --- /dev/null +++ b/muh/include/muh/tuning/tuning_find_bound_sorted_values.cuh @@ -0,0 +1,33 @@ +// muh/include/muh/tuning/tuning_find_bound_sorted_values.cuh — BI-V100 +// +// Mirrors: cccl_upstream/cub/cub/device/dispatch/tuning/tuning_find_bound_sorted_values.cuh +// CCCL: threads=256, items=8, binary search per thread +// +// vllm relevance: block_table index lookup in paged attention +// SMEM risk: minimal (binary search, no tile) + +#pragma once + +#include "muh/hardware.cuh" +#include "muh/tuning/common.cuh" + +namespace muh::tuning::find_bound { + +struct FindBoundPolicy { + int threads_per_block; + int items_per_thread; + CacheLoadModifier haystack_load_modifier; + CacheLoadModifier needles_load_modifier; +}; + +struct policy_selector { + int haystack_type_size; + int needle_type_size; + + constexpr FindBoundPolicy operator()(const hardware_capability& /*hw*/) const { + // CCCL: fixed policy for all architectures + return {256, 8, LOAD_LDG, LOAD_LDG}; + } +}; + +} // namespace muh::tuning::find_bound