Archived
Radiance becomes a multi-model engine: one process serves several models behind one port, loads each when a request names it, parks it in host memory or restores it from its container, and shares the cards between them (docs/MULTIMODEL.md). The configuration is one YAML file; the command line flags are gone (`radiance --config FILE`, hot reload on SIGHUP). Formats. IQ8R (rotated int8) and IQR-V4 replace FP8 and MXFP4 as whole-model formats, with an int8 KV cache (`kv-cache-dtype: i8`) in place of the fp8 one. Containers whose weights are block FP8, MXFP4, M2XFP4, NVFP4 or ParoQuant are refused at startup by the name of the first such weight. Not served until they have int8 containers: GLM-5.3-Flash, Ornith-1.5, Sage-A1.5, Nemotron-3.5-Bolt-74B, Ling-3.0-flash, drama-3 and Anima's FP8 container; Nemotron-3.5-Bolt-E4B, the Gemma 4 31B DFlash containers and MiniCPM5-2B bf16 serve without their drafter. 1.17.0 serves all of them. Speed. Chained launches for Qwen3.8-27B, Gemma 4, Gemma 3 and the small bf16 models, a new Qwen3.8-Flash-Next container (IQR-V4 experts, int8 trunk) with its decode step and prefill reworked, and a reworked adaptive draft window. Deployment. deploy/compose has two fleet files, tp1.yaml and tp2.yaml, each with its configuration beside it, in place of the per-model files. `host-pool-mib` is a model's host pool in all, split among its ranks. The dashboard is rebuilt: an hour of history kept by the server, each accelerator's memory by model, model states over time. Merged since 1.17.0: Nemotron-3.5-Bolt-74B-A9B by keptn42 (#339); GLM-5.3-Flash on four cards by AnimusNull (#397); chained launches for Flash-Next's decode step (#396) and preempted requests keeping their prefix and place (#405) by mici81; --prefill-interleave auto by Code000 (#410); eight more libr3d kernels and the w4a4 reference by RikshaDriver (#403, #407, #408); libr3d large-BAR and E4M3 decode fixes by neuromanMD (#438, #439); int4/int5 decode tiles by Kezi (#426); attention for Nanbeige 4.3 33B by everplays (#417); expert_stats_report.py by baKon (#431). Fixed: #398, #402, #419, #437 (dschmitz's patch); added the metrics of #392, and multi-model serving as asked for in #367 and #109. Plugin ABI 39: out-of-tree plugins need to be rebuilt. Thanks to @keptn42, @AnimusNull, @mici81, @Code000, @RikshaDriver, @neuromanMD, @Kezi, @everplays, @baKon and @dschmitz.
111 lines
6.5 KiB
CMake
111 lines
6.5 KiB
CMake
# tools/ -- rad-info, rad-convert, rad-kbench, rad-tune, rad-yaml, and the smaller checkers below.
|
|
#
|
|
# rad_add_tool tools link rad_core: rad-convert, rad-kbench and rad-tune are the engine's startup
|
|
# with a different last step, loading the same plugins in the same hierarchy and running the same
|
|
# declare phase (spec §4.4, §15, §17), so they resolve kernels exactly as the engine does.
|
|
#
|
|
# iface.cpp is the seam onto core/plugin and core/build and the flag parsing every tool shares,
|
|
# opshapes.cpp the operand sizing shared by rad-kbench and rad-tune, kfixture.cpp the recorded
|
|
# kernel fixture and its input draw, and kbench_core.cpp rad-kbench's rules (comparison,
|
|
# tolerances, keys, the reference cache). They are compiled into each tool; a library target is not
|
|
# worth it for four files.
|
|
|
|
set(RAD_TOOL_SHARED
|
|
${CMAKE_CURRENT_SOURCE_DIR}/iface.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/opshapes.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/kfixture.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/kbench_core.cpp)
|
|
|
|
function(rad_add_tool name src)
|
|
add_executable(${name} ${src} ${RAD_TOOL_SHARED})
|
|
# WHOLE_ARCHIVE: a host that dlopens a plugin must present the whole plugin-facing ABI, declare
|
|
# and run phase alike. A plain archive link drops objects the tool does not reference (e.g.
|
|
# rad-convert never calls rad_issue), and the architecture plugin then fails to load.
|
|
target_link_libraries(${name} PRIVATE "$<LINK_LIBRARY:WHOLE_ARCHIVE,rad_core>")
|
|
target_include_directories(${name} PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
${CMAKE_SOURCE_DIR}/core
|
|
${CMAKE_SOURCE_DIR}/abi)
|
|
# No home definition here: rad_abi carries RAD_DEFAULT_HOME to the engine and tools alike, and
|
|
# iface.cpp's rad_home() reads it, so there is one default home.
|
|
#
|
|
# ENABLE_EXPORTS is required: the host implements the declare-phase C ABI (rad_decl_weight,
|
|
# rad_decl_op, rad_declare_logits, ...) and an architecture plugin binds to it at dlopen. Kernel
|
|
# plugins only export, so rad-schemas and r4d_selftest do not need it.
|
|
set_target_properties(${name} PROPERTIES
|
|
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
|
ENABLE_EXPORTS ON)
|
|
endfunction()
|
|
|
|
rad_add_tool(rad-info rad_info.cpp)
|
|
|
|
# The tokeniser's independent reference encoder (tokref.h), which core/text's pre-tokeniser is
|
|
# checked against. A library because tests/tokenizer_test uses it too; core/ does not link it.
|
|
add_library(rad_tokref STATIC ${CMAKE_CURRENT_SOURCE_DIR}/tokref.cpp)
|
|
target_link_libraries(rad_tokref PUBLIC rad_core)
|
|
target_include_directories(rad_tokref PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/core)
|
|
|
|
# rad-tokcheck needs neither plugins nor the declare phase, so it links the core plainly.
|
|
add_executable(rad-tokcheck rad_tokcheck.cpp ${CMAKE_CURRENT_SOURCE_DIR}/iface.cpp)
|
|
target_link_libraries(rad-tokcheck PRIVATE rad_tokref rad_core)
|
|
set_target_properties(rad-tokcheck PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
|
|
# rad-yaml writes a command line as the YAML configuration; it parses flags and nothing else.
|
|
add_executable(rad-yaml rad_yaml.cpp)
|
|
target_link_libraries(rad-yaml PRIVATE rad_core)
|
|
set_target_properties(rad-yaml PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
|
|
# rad-schemas links no core: it dlopens plugins and reads their static schema tables, so it works on
|
|
# a plugin the engine cannot load.
|
|
add_executable(rad-schemas rad_schemas.cpp)
|
|
target_link_libraries(rad-schemas PRIVATE rad_abi ${CMAKE_DL_LIBS})
|
|
set_target_properties(rad-schemas PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
rad_add_tool(rad-convert rad_convert.cpp)
|
|
# Optional OpenMP across weights and within a large one.
|
|
find_package(OpenMP QUIET)
|
|
if(OpenMP_CXX_FOUND)
|
|
target_link_libraries(rad-convert PRIVATE OpenMP::OpenMP_CXX)
|
|
else()
|
|
message(STATUS "rad-convert: no OpenMP -- conversion will run single-threaded")
|
|
endif()
|
|
rad_add_tool(rad-kbench rad_kbench.cpp)
|
|
# The timing pass (--bench): the only part of rad-kbench that needs the device layer's internals.
|
|
target_sources(rad-kbench PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/kbench_timer.cpp)
|
|
rad_add_tool(rad-tune rad_tune.cpp)
|
|
|
|
# GBNF mask engine acceptance run: tests/gbnf_test.cpp's differential and latency suite against a
|
|
# real tokenizer.json and chat template. It loads no plugin, and is not installed because it
|
|
# compiles in test code (tests/gbnf_oracle.cpp, upstream's candidate walk) as its oracle.
|
|
add_executable(rad-gbnf-check rad_gbnf_check.cpp ${CMAKE_SOURCE_DIR}/tests/gbnf_oracle.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/iface.cpp)
|
|
target_link_libraries(rad-gbnf-check PRIVATE rad_core)
|
|
target_include_directories(rad-gbnf-check PRIVATE
|
|
${CMAKE_SOURCE_DIR}/core ${CMAKE_SOURCE_DIR}/abi ${CMAKE_SOURCE_DIR}/tests
|
|
${CMAKE_CURRENT_SOURCE_DIR})
|
|
set_target_properties(rad-gbnf-check PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
|
|
# rad-schemas matters most in an installed prefix: it needs only the four exports every kernel
|
|
# plugin has, so it can debug an out-of-tree plugin the engine cannot load.
|
|
install(TARGETS rad-info rad-convert rad-kbench rad-tune rad-schemas rad-tokcheck rad-yaml
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
# rad-chatparse: the reply parser's acceptance run against a checkpoint's real tokenizer and chat
|
|
# template, compared with the legacy parser in tests/legacy/. It shares that parser and the
|
|
# differential harness with tests/chatparse_test, so it is built only with the tests.
|
|
if(RAD_BUILD_TESTS)
|
|
# Its --request mode loads the architecture plugin for the model's declared reply format, so it
|
|
# is a plugin host like rad_add_tool's tools: the whole of rad_core, with its symbols exported.
|
|
# The legacy parser's sources are compiled in rather than linked as rad_legacy_toolparse, which
|
|
# links rad_core without that feature.
|
|
add_executable(rad-chatparse rad_chatparse.cpp chatparse_serve.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/iface.cpp
|
|
${CMAKE_SOURCE_DIR}/tests/legacy/toolparse_legacy.cpp
|
|
${CMAKE_SOURCE_DIR}/tests/legacy/chatdiff.cpp)
|
|
target_link_libraries(rad-chatparse PRIVATE "$<LINK_LIBRARY:WHOLE_ARCHIVE,rad_core>")
|
|
target_include_directories(rad-chatparse PRIVATE ${CMAKE_SOURCE_DIR}/core ${CMAKE_SOURCE_DIR}/abi
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
${CMAKE_SOURCE_DIR}/tests/legacy)
|
|
set_target_properties(rad-chatparse PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
|
ENABLE_EXPORTS ON)
|
|
endif()
|