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++

gdn_chunk_parity: skip (77) on a card whose shared-memory opt-in cannot hold the kkt stage (Pascal), instead of failing

Niko12214ef3855745c7
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4545bcc5e..1fae7183c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -935,6 +935,7 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP)
target_include_directories(gdn_chunk_parity PRIVATE ${_strata_gpu_include_directories})
target_link_libraries(gdn_chunk_parity PRIVATE strata_prefill ${_strata_gpu_runtime_target})
add_test(NAME gdn_chunk_parity COMMAND gdn_chunk_parity --selftest)
+ set_tests_properties(gdn_chunk_parity PROPERTIES SKIP_RETURN_CODE 77)
# v100/gdn-chunk: the micro benchmark (CUDA events, real GDN shapes): chunked vs recurrent prompt path.
add_executable(gdn_chunk_bench bench/gdn_chunk_bench.cpp)
diff --git a/src/kernels/gdn_chunk_parity.cpp b/src/kernels/gdn_chunk_parity.cpp
index e60fdc841..2a2716945 100644
--- a/src/kernels/gdn_chunk_parity.cpp
+++ b/src/kernels/gdn_chunk_parity.cpp
@@ -258,6 +258,17 @@ int main(int argc, char** argv) {
if (std::strcmp(argv[i], "--selftest") == 0) selftest = true;
else { std::fprintf(stderr, "usage: gdn_chunk_parity [--selftest]\n"); return 2; }
}
+ {
+ // the kkt stage needs 2*64*129 floats (66 KB) of dynamic shared memory: a card whose opt-in limit is lower
+ // (Pascal: 48 KB) cannot launch it, and the engine dispatch never selects the chunked path there
+ int dev = 0, smem = 0;
+ cudaGetDevice(&dev);
+ cudaDeviceGetAttribute(&smem, cudaDevAttrMaxSharedMemoryPerBlockOptin, dev);
+ if (smem < 2 * 64 * 129 * 4) {
+ std::printf("gdn_chunk_parity: the card's shared-memory opt-in (%d B) is below the kkt stage's need, skipped\n", smem);
+ return 77;
+ }
+ }
if (!strata::prefill::gdn_chunk_available())
std::printf("note: not a V100 (cc 7.0) - the parity still runs; the engine dispatch keeps the recurrence\n");
run_case(64, 1);