Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

dsv41: portable (FMA) tile test target, docs for the trellis experts

Niko122112a3c0739e9d
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e3478900b..b4082fdd6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -796,6 +796,16 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP)
${CMAKE_CURRENT_SOURCE_DIR}/third_party/ggml ${CMAKE_CURRENT_SOURCE_DIR}/src/kernels/cpu)
target_link_libraries(ds4_tq_test PRIVATE strata_kernels_cpu ${_strata_gpu_runtime_target} Threads::Threads)
target_compile_definitions(ds4_tq_test PRIVATE STRATA_DSV41_TQ_CPU=1)
+ # the same with the plain-FMA tile instead of the gfx12 WMMA one (what CUDA and gfx11 builds run)
+ add_executable(ds4_tq_test_portable tests/dsv41/tq_expert_test.cpp src/dsv41/ds4_tq.cu src/dsv41/ds4_iq.cu src/dsv41/ds4_tq_cpu.cpp
+ src/dsv41/ds4_iq_cpu.cpp tools/trellis/tqenc.cpp)
+ target_include_directories(ds4_tq_test_portable PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include ${_strata_gpu_include_directories}
+ ${CMAKE_CURRENT_SOURCE_DIR}/third_party/ggml ${CMAKE_CURRENT_SOURCE_DIR}/src/kernels/cpu)
+ target_link_libraries(ds4_tq_test_portable PRIVATE strata_kernels_cpu ${_strata_gpu_runtime_target} Threads::Threads)
+ target_compile_definitions(ds4_tq_test_portable PRIVATE STRATA_DSV41_TQ_CPU=1 DS4_TQ_PORTABLE=1)
+ if(STRATA_ENABLE_HIP)
+ target_compile_options(ds4_tq_test_portable PRIVATE "$<$<COMPILE_LANGUAGE:HIP,CXX>:SHELL:-include ${CMAKE_CURRENT_SOURCE_DIR}/include/strata/dsv41/hip_extra.h>")
+ endif()
if(STRATA_ENABLE_HIP)
target_compile_options(ds4_tq_test PRIVATE "$<$<COMPILE_LANGUAGE:HIP,CXX>:SHELL:-include ${CMAKE_CURRENT_SOURCE_DIR}/include/strata/dsv41/hip_extra.h>")
endif()
diff --git a/docs/DEEPSEEK41.md b/docs/DEEPSEEK41.md
index d2d3c1631..94cebf441 100644
--- a/docs/DEEPSEEK41.md
+++ b/docs/DEEPSEEK41.md
@@ -51,5 +51,25 @@ The server speaks to the engine as it does for the other models, so `/v1/chat/co
A value marked `string="true"` stays a string.
- Defaults when a request names none: temperature 1.0, top_p 1.0.
-Not in this version: pictures, the DSpark drafter, several requests at once (`--parallel` is ignored with a note), tuning
+Pictures and the DSpark drafter are in the engine (strata-dsv41 reads them from the unsloth mmproj and dspark files beside the model; the server side is not wired yet). Not in this version: several requests at once (`--parallel` is ignored with a note), tuning
(`--tune` is skipped with a note).
+
+## Compressed experts (trellis), for testing
+
+`strata-dsv41` reads the routed experts in the trellis types as well as the source MXFP4: TQK6 and TQK7 (agentionai's files), and the
+experimental TQK5X / TQK4X (computed codebook) and TQK5T / TQK4T (table codebook), see `tools/trellis/README.md`. A layer may be converted
+while the others stay MXFP4. On the GPU they run on the tensor cores of gfx12 (and in plain FMAs elsewhere), on the CPU lane on Strata's
+AVX-512 / AVX2 kernels; the build needs `-DSTRATA_NATIVE_EXPERTS=ON` for the CPU lane.
+
+```
+# 1. the pack of the source model (also takes the DSpark and mmproj files that sit beside the model folder)
+python tools/dsv41/pack_gguf.py --model DIR/UD-Q8_K_XL --out PACK
+# 2. re-encode some layers (HIP encoder; one layer at K5 is 2.3 GB, the whole model 93 GB)
+python tools/dsv41/tq_convert.py --pack PACK --out CONV --layers 1,7,14 --type K5 # K4 K5 K4T K5T K6 K7
+# 3. the pack that reads them
+python tools/dsv41/pack_gguf.py --model DIR/UD-Q8_K_XL --out PACK2 --tq-experts CONV
+strata-dsv41 --pack PACK2 --score data/quant_quality/v1/set.ids.json --score-out RUN.tsv # teacher-forced top-64 rows
+```
+
+The encode is plain error (no rotation, no activation weights). The tests are `ds4_tq_test` (device and CPU lane against a double
+reference, needs one GPU) and `tqw_hip_test`.
diff --git a/src/dsv41/ds4_tq.cu b/src/dsv41/ds4_tq.cu
index 63883c646..e96298716 100644
--- a/src/dsv41/ds4_tq.cu
+++ b/src/dsv41/ds4_tq.cu
@@ -21,7 +21,7 @@
#include <cstdio>
#include <cstdlib>
-#if defined(STRATA_USE_HIP) && (defined(__GFX12__) || defined(__gfx1200__) || defined(__gfx1201__))
+#if defined(STRATA_USE_HIP) && !defined(DS4_TQ_PORTABLE) && (defined(__GFX12__) || defined(__gfx1200__) || defined(__gfx1201__))
#define DS4_TQ_WMMA 1
#endif