mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3074] [CLOSED] Fix crash (0xC0000005) when Qwen3.6's Q2_0 experts are offloaded to the CPU pool #4437
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4437
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/3074
Author: @wanlemur
Created: 10/18/2026
Status: ❌ Closed
Base:
main← Head:fix/q36-q20-actq📝 Commits (1)
57130a0fill the CPU pool's ActQ activations for native Q2_0 expert layers📊 Changes
1 file changed (+11 additions, -2 deletions)
View changed files
📝
src/qwen35/q36_engine.cu(+11 -2)📄 Description
Overview
The 2-bit GSQ quant of Qwen3.6-35B-A3B (
chitsgit/Qwen3.6-35B-A3B-2Bit-GSQ-hybrid-GGUF) runs great as long as every routed expert fits into VRAM. However, whenever I tried running it in hybrid mode—offloading some of the experts to the CPU pool—it crashed immediately during warm-up with an access violation (0xC0000005) across all worker threads.Whats wrong
I traced the root cause to the CPU pool activations: native 2-bit (Q2_0) CPU kernels don't read standard activations directly. Instead, they expect activations pre-quantized into a specialized layout (
ActQ) that stores the quantized data alongside scaling factors.The
q36engine set up the standard activation buffer for hybrid layers, but left theActQpointer uninitialized (nullptr). When worker threads picked up a Q2_0 expert job, they tried to read scale factors from this null pointer and crashed immediately. The Flash-Next engine already handles this case properly, butq36never got the equivalent logic.How I fixed it
I mirrored the approach used in Flash-Next: before dispatching expert jobs to the pool, I check the layer's quantization format.
ActQbuffer on the fly and hand that pointer to the worker job.With this in place, hybrid mode runs completely stable. On my RX 7800 XT with 155 of 256 experts per layer in VRAM (and the rest in system RAM), decode speed sits at 41.8 tok/s—on par with UD-Q4_K_XL in the same scenario, where it previously crashed on startup.
What Changed
All edits
src/qwen35/q36_engine.cuinside the CPU pool logic:ActQstructures and activation quantization helpers.ActQbuffer: I added a vector ofActQstructures to the engine class and resized it alongside the existing activation allocations during expert placement.ActQbuffer and give the worker job theActQpointer. If no: I pass the standard activation buffer pointer as before.I didn't need to touch the pool scheduler or compute kernels: the down-projection pass already quantizes its own intermediate buffers between phases, and Qwen3.6’s layer dimensions (embedding dimension 2048, expert intermediate size 512) divide cleanly into the kernel's 64-element block size.
Benchmarks
My test setup: AMD Radeon RX 7800 XT (16 GB), RAM 32GB, Ryzen 7 7700, Strata 0.1.45 + this patch.
I benchmarked three configurations:
(Hybrid, 32K ctx)
(Hybrid, 64K ctx)
Key Takeaways:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.