Repository navigation
force qwen35 to treat IGPU like a GPU so DSpark does not fall back to CPU - #88
Conversation
There was a problem hiding this comment.
Pull request overview
Updates Qwen3.5 device handling to prevent fused GDN from falling back to CPU on integrated CUDA GPUs.
Changes:
- Treats
IGPUdevices like discrete GPUs in the rows-mode guard. - Preserves rows mode only for supported CPU/Metal configurations.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
khosravipasha
left a comment
There was a problem hiding this comment.
Confirmed the root cause in the code: GB10-class devices report GGML_BACKEND_DEVICE_TYPE_IGPU (ggml-cuda.cu integrated→IGPU), so the old != GPU guard skipped them and left the CPU/Metal-only src[6] rows variant enabled → CUDA rejects it → whole fused-GDN path falls to CPU. This fix is exactly right, and regression-free: Metal reports GPU (rows stays on), and discrete CUDA is an identical codepath before/after — only IGPU behavior changes, to the correct value. Builds clean. LGTM.
Overview
Fixes PrismML-Eng/Bonsai-demo#112
On unified-memory CUDA devices (e.g. DGX Spark GB10), the CUDA backend
reports device type IGPU, not GPU. The rows-mode guard in
build_layer_attn_linear (src/models/qwen35.cpp) only inspects GPU-type
devices, IGPU devices are skipped and the src[6] GDN variant (CPU/Metal
only) stays enabled. CUDA's supports_op then rejects it, the scheduler
moves the op to CPU, and the fused-GDN probe disables fused GDN for the
whole run - silently, with only two log warnings.
The fix makes IGPU be treated the same as GPU in the guard, matching how discrete
cards already behave.
Additional information
Measured this on a DGX Spark (GB10, sm_121, CUDA 13.2), Ternary-Bonsai-27B-Q2_0 +
dspark Q4_1 drafter, 512-token prompt, temperature 0, using the reproduction
command from the linked issue:
After the fix the CPU-assignment / "set to disabled" warnings are gone and
the ~2x speculative speedup from SPECULATIVE.md holds on this hardware.
Requirements