Critical fix based on commit 41ecb8c's discovery:
enginex-vllm-bi100-qwen36 has NO .cu source files. All 9 csrc/*.cu
injection targets in VLLM_INJECTION_POINTS are dead — patches generated
by gen_patch.py have zero effect on the running system.
Old (DEAD):
reduce → csrc/attention/attention_kernels.cu (does not exist)
topk → csrc/sampling/sampling_kernels.cu (does not exist)
scan → csrc/attention/paged_attention_v1.cu (does not exist)
... etc
New (REAL):
prefill → prefix_prefill.py BLOCK/NUM_WARPS (Triton JIT tl.constexpr)
flash_attn → triton_flash_attention.py BLOCK_M/BLOCK_N (Triton autotune)
moe → fused_moe.py BLOCK_SIZE_M (only param ixformer reads)
runtime → _custom_ops.py SMEM (48KB fix)
scheduler → computility-run.yaml num-scheduler-steps
Dead targets preserved as comments for documentation.
Also read: cub/device/dispatch/kernels/kernel_scan.cuh
- DeviceScanInitKernel initializes tile_state for lookback
- __launch_bounds__(threads, 1): max 1 CTA/SM for scan (full SMEM)
- Lookahead requires CUDACC >= 12.8 (not available on BI-V100)
Source: cccl_upstream/cub/cub/device/dispatch/kernels/kernel_scan.cuh
Registers all 26 CUB algorithms with metadata:
- 6 'injection' mode: have VLLM_INJECTION_POINTS (reduce/scan/topk/transform/batch_memcpy/for)
- 20 'library' mode: used via CCCL device API, no direct #define injection
- struct_mode: 'named' (bi100_* structs) vs 'inline' (policy_selector returns)
Also adds coverage reporting to generate_patches().
Problems fixed:
1. gen_patch.py was reading .muh YAML (all nulls) instead of C++ headers.
Now it parses bi100_* structs directly from tuning_*.cuh via regex,
extracts constexpr values, and maps them to vllm injection points.
Verified: 11 patches generated from 6 algorithms.
2. C++ headers had no build system or tests.
Added CMakeLists.txt (header-only library target) and compile_test.cpp.
Verified: g++ -std=c++17 compiles all headers, 17/17 runtime checks pass.
Also added cuda_compile_test.cu for when nvcc is available.
3. baseline.muh had a tuning section full of nulls duplicating C++ values.
Stripped to vllm launch config only. Tuning values live exclusively
in muh/include/muh/tuning/tuning_*.cuh bi100_* structs.
4. Fixed constexpr goto in tuning_scan.cuh (C++17 doesn't allow goto in
constexpr; replaced with early-return + default: break pattern).
Data flow is now:
tuning_*.cuh (bi100_* constexpr) ──→ gen_patch.py ──→ vllm patches
baseline.muh (launch config) ──→ gen_yaml.py ──→ computility-run.yaml
compile_test.cpp ──→ g++/nvcc ──→ verify values are real