Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/BASINKV.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ step and prefetches the highest-scoring blocks asynchronously over PCIe before t

Supported in v1:
- **Architectures**: `qwen35moe`, `clover_moe`, `qwen4exp`, and `inkling2` (`Qwen3.6-35B-A3B`, `Qwen4-35B-A3B`, `Groot 19B-A3B`, `Ornith 1.5`, `Tiel Coder`, `Clover`, `Inkling 2 Mini`) on `strata-poly`.
- **Backends**: CUDA (validated on NVIDIA RTX 4070 Laptop 8 GB on Windows and NVIDIA RTX 4090 D 24 GB on Linux) and HIP (shared `hip_compat` code; compiled and linked cleanly under ROCm `10.2.0a20260930` and community-verified on physical AMD Radeon RX 9070 XT 16 GB `gfx1201` with `UD-IQ4_XS` `8/8` exact NIAH `8K–505K` at flat `13.69–14.28 GB` VRAM — see [community RX 9070 XT report](bench-results/2026-12-04-community-rx-9070-xt-qwen4-35b-a3b-ud-iq4-xs/README.md)). Not supported on Metal unified memory (stubbed in `engine/metal/src/poly/unported.cpp`, compiled and passed 8/8 Metal `ctest` parity checks on Apple M5 Ultra).
- **Backends**: CUDA (validated on NVIDIA RTX 4070 Laptop 8 GB on Windows and NVIDIA RTX 4090 D 24 GB on Linux), HIP (shared `hip_compat` code; compiled and linked cleanly under ROCm `10.2.0a20260930` and community-verified on physical AMD Radeon RX 9070 XT 16 GB `gfx1201` with `UD-IQ4_XS` `8/8` exact NIAH `8K–505K` at flat `13.69–14.28 GB` VRAM — see [community RX 9070 XT report](bench-results/2026-12-04-community-rx-9070-xt-qwen4-35b-a3b-ud-iq4-xs/README.md)), and Metal (`engine/metal/src/poly/basinkv.{cpp,metal}`, opt-in via `strata-poly --basinkv`).
- **Limits**: single sequence (`--batch 0`), not combined with `--kv-resident` or `--kv` (BasinKV manages its own FP16 hot slab and quantized host tier).
- **Speculative decoding**: compatible with embedded MTP (`qwen35moe` and `qwen4exp` `blk.40`) and external DFlash2 (`qwen4exp` `--draft-model`). On `inkling2`, `--draft-model` is not yet combined with `--basinkv`.

Expand Down
10 changes: 8 additions & 2 deletions engine/metal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ target_link_libraries(window_probe PRIVATE strata_metal_kernels strata_metal_hos
# The smaller-family engine keeps the shared line protocol, expert cache, CPU
# experts, batching, conversations and speculative decoding.
if(STRATA_METAL_POLY)
target_sources(strata_poly_metal_kernels PRIVATE src/poly/quantized.cpp src/poly/inkling.cpp src/poly/qwen4.cpp src/poly/dflash2_poly.cpp src/poly/unported.cpp)
target_sources(strata_poly_metal_kernels PRIVATE src/poly/quantized.cpp src/poly/inkling.cpp src/poly/qwen4.cpp src/poly/dflash2_poly.cpp src/poly/basinkv.cpp src/poly/unported.cpp)
if(NOT TARGET strata_quant)
message(FATAL_ERROR "strata-poly on Metal needs the Strata quant layer (STRATA_OWN_CPU_QUANT=ON)")
endif()
Expand All @@ -274,7 +274,8 @@ if(STRATA_METAL_POLY)
STRATA_POLY_INKLING_SOURCE="${CMAKE_CURRENT_SOURCE_DIR}/src/poly/inkling.metal"
STRATA_POLY_INKLING_FLASH_SOURCE="${CMAKE_CURRENT_SOURCE_DIR}/src/poly/inkling_flash.metal"
STRATA_POLY_QWEN4_SOURCE="${CMAKE_CURRENT_SOURCE_DIR}/src/poly/qwen4.metal"
STRATA_POLY_DFLASH2_SOURCE="${CMAKE_CURRENT_SOURCE_DIR}/src/poly/dflash2.metal")
STRATA_POLY_DFLASH2_SOURCE="${CMAKE_CURRENT_SOURCE_DIR}/src/poly/dflash2.metal"
STRATA_POLY_BASINKV_SOURCE="${CMAKE_CURRENT_SOURCE_DIR}/src/poly/basinkv.metal")
target_link_libraries(strata_poly_metal_kernels PUBLIC strata_quant)
add_executable(strata-poly ${S}/poly/main.cpp ${S}/poly/engine.cpp ${S}/poly/basinkv.cpp ${S}/poly/qwen35.cpp ${S}/poly/qwen4.cpp
${S}/poly/gemma4.cpp ${S}/poly/lfm2moe.cpp ${S}/poly/glm5next.cpp ${S}/poly/deepseek4.cpp ${S}/poly/flint.cpp
Expand All @@ -291,11 +292,16 @@ if(STRATA_METAL_POLY)
add_executable(poly_dflash2_metal_test ${S}/poly/dflash2_poly_test.cu)
target_include_directories(poly_dflash2_metal_test PRIVATE ${S}/poly)
target_link_libraries(poly_dflash2_metal_test PRIVATE strata_poly_metal_kernels strata_quant)
add_executable(poly_basinkv_parity poly_tests/basinkv_parity.cpp ${S}/poly/basinkv.cpp)
target_include_directories(poly_basinkv_parity PRIVATE ${S}/poly)
target_link_libraries(poly_basinkv_parity PRIVATE strata_poly_metal_kernels)
if(BUILD_TESTING)
add_test(NAME poly_norm_q8_metal_test COMMAND poly_norm_q8_metal_test)
set_tests_properties(poly_norm_q8_metal_test PROPERTIES LABELS "metal;gpu;poly" RESOURCE_LOCK metal_gpu TIMEOUT 120)
add_test(NAME poly_dflash2_metal_test COMMAND poly_dflash2_metal_test)
set_tests_properties(poly_dflash2_metal_test PROPERTIES LABELS "metal;gpu;poly" RESOURCE_LOCK metal_gpu TIMEOUT 180)
add_test(NAME poly_basinkv_parity COMMAND poly_basinkv_parity)
set_tests_properties(poly_basinkv_parity PROPERTIES LABELS "metal;gpu;poly" RESOURCE_LOCK metal_gpu TIMEOUT 180)
endif()
endif()

Expand Down
Loading
Loading