Files
project_6_89d52222/muh/include/muh/tuning/tuning_histogram.cuh
Claude 07b015f31e [MUH] Complete all 26 CCCL algorithm tuning headers — full parity with cub/device/dispatch/tuning/
Added 20 missing tuning headers (was 6, now 26):
  P1: radix_sort, reduce_by_key, scan_by_key, select_if, histogram,
      merge, merge_sort, unique_by_key, batched_topk, transform_tile
  P2: segmented_reduce, segmented_scan, segmented_sort,
      segmented_radix_sort, three_way_partition, rle_encode,
      rle_non_trivial_runs
  P3: adjacent_difference, find, find_bound_sorted_values

Updated muh.cuh to include all 26 headers (v0.2.0).
All headers compile clean (g++ -std=c++17), compile_test passes 17/17.
gen_patch.py reads bi100_* structs from all 26 files.

Coverage: muh now has a tuning header for every CCCL tuning_*.cuh file.
2026-07-30 14:19:51 +00:00

44 lines
1.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// muh/include/muh/tuning/tuning_histogram.cuh — BI-V100 histogram tuning
//
// Mirrors: cccl_upstream/cub/cub/device/dispatch/tuning/tuning_histogram.cuh
// vllm impact: token frequency counting in sampling
// Competition weight: Output TPS × 16.796
#pragma once
#include "muh/hardware.cuh"
#include "muh/tuning/common.cuh"
namespace muh::tuning::histogram {
struct HistogramPolicy {
int threads_per_block;
int pixels_per_thread;
int vec_size;
BlockLoadAlgorithm load_algorithm;
CacheLoadModifier load_modifier;
};
struct bi100_default {
static constexpr int threads = 768;
static constexpr int items = 12;
static constexpr int vec_size = 4;
static constexpr int load_algo = BLOCK_LOAD_DIRECT;
static constexpr int load_mod = LOAD_LDG;
};
struct policy_selector {
int sample_size;
int num_channels;
constexpr HistogramPolicy operator()(const hardware_capability& hw) const {
if (hw.at_least(hardware_capability::vendor_t::iluvatar, 100)) {
return {bi100_default::threads, bi100_default::items, bi100_default::vec_size, BLOCK_LOAD_DIRECT, LOAD_LDG};
}
// Fallback
return {bi100_default::threads, bi100_default::items, bi100_default::vec_size, BLOCK_LOAD_DIRECT, LOAD_LDG};
}
};
} // namespace muh::tuning::histogram