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
41 lines
1.4 KiB
CMake
41 lines
1.4 KiB
CMake
cmake_minimum_required(VERSION 3.18)
|
|
project(muh LANGUAGES CXX)
|
|
|
|
# muh is a header-only library
|
|
add_library(muh INTERFACE)
|
|
target_include_directories(muh INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
|
target_compile_features(muh INTERFACE cxx_std_17)
|
|
|
|
# If CCCL is available, link it
|
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../cccl_upstream/cub/cub/config.cuh")
|
|
target_include_directories(muh INTERFACE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../cccl_upstream/cub
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../cccl_upstream/thrust
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../cccl_upstream/libcudacxx/include
|
|
)
|
|
target_compile_definitions(muh INTERFACE MUH_HAS_CCCL=1)
|
|
endif()
|
|
|
|
# Compile test — verifies all headers parse without errors
|
|
# This is a host-only test (no GPU needed)
|
|
option(MUH_BUILD_TESTS "Build muh compile tests" ON)
|
|
|
|
if(MUH_BUILD_TESTS)
|
|
add_executable(muh_compile_test
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../test/compile_test.cpp
|
|
)
|
|
target_link_libraries(muh_compile_test PRIVATE muh)
|
|
|
|
# If we have a CUDA compiler, also test .cu compilation
|
|
include(CheckLanguage)
|
|
check_language(CUDA)
|
|
if(CMAKE_CUDA_COMPILER)
|
|
enable_language(CUDA)
|
|
add_executable(muh_cuda_compile_test
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../test/cuda_compile_test.cu
|
|
)
|
|
target_link_libraries(muh_cuda_compile_test PRIVATE muh)
|
|
set_target_properties(muh_cuda_compile_test PROPERTIES CUDA_STANDARD 17)
|
|
endif()
|
|
endif()
|