You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Qwen3.5-4B: quant_generate works but quant_ask produces empty/garbage output #69
Qwen3.5-4B (DeltaNet hybrid) loads successfully and produces coherent output via quant_generate, but quant_ask returns empty/garbage tokens. This breaks the server API since quant-server uses quant_ask for non-streaming requests.
Evidence
quant_generate (CLI) — WORKS
$ ./qwen35_test Qwen3.5-4B-Q4_K_M.gguf "Hello, who are you?"
--- response ---
I am Qwen3.5, a large language model developed by Alibaba Cloud.
I can help you with various tasks such as answering questions,
solving problems, and generating content.
Update: quant_generate also produces empty tokens via Python ctypes
Switched the Python server from quant_ask to quant_generate with streaming callback — same result: empty/whitespace-only tokens.
However, the exact same C code compiled as a standalone binary produces perfect output:
$ ./qwen35_test Qwen3.5-4B-Q4_K_M.gguf "Hello, who are you?"
I am Qwen3.5, a large language model developed by Alibaba Cloud.
This narrows the issue to the Python ctypes / shared library boundary:
Standalone binary (statically links quant.h) → WORKS
Python ctypes loading libquant.dylib → BROKEN for Qwen3.5 (but works for Phi-3.5 and SmolLM2)
Hypothesis
Qwen3.5's DeltaNet layers use large FP32 dequantized tensors (24 layers × attn_qkv dequant). The cc -shared -fPIC build may handle memory differently than cc -O2 static builds:
PIC relocation could affect tensor pointer alignment
The large FP32 buffers (~2GB) may interact with macOS dylib memory limits
Global state in quant.h (static variables) may not initialize correctly in shared library mode
Suggested investigation
Test with -fno-pic or position-dependent code
Check if the issue is specific to DeltaNet layers (Phi-3.5 has no DeltaNet and works fine via ctypes)
Try building the shared library with the same flags as the standalone binary
Update: Qwen3.5-4B basic fact extraction works (3/3)
Direct tests show Qwen3.5-4B can extract facts correctly:
"How old is Mary?" → "30" ✅
"Capital of France?" → "Paris" ✅
"Who was CTO?" → "Dr. Maria Santos" ✅
The Acme 2/7 failure is NOT a model capability issue. Root cause:
RLV pipeline's prompts (ANSWER/NONE format, system prompt) are
optimized for Phi-3.5's output patterns. Qwen3.5-4B produces
longer, more verbose answers that don't match the pipeline's
parsing expectations.
Fix: prompt tuning for Qwen3.5-4B's response style, or a
model-agnostic prompt format.
Activity
unamedkr commentedon Apr 12, 2026
Update: quant_generate also produces empty tokens via Python ctypes
Switched the Python server from
quant_asktoquant_generatewith streaming callback — same result: empty/whitespace-only tokens.However, the exact same C code compiled as a standalone binary produces perfect output:
This narrows the issue to the Python ctypes / shared library boundary:
libquant.dylib→ BROKEN for Qwen3.5 (but works for Phi-3.5 and SmolLM2)Hypothesis
Qwen3.5's DeltaNet layers use large FP32 dequantized tensors (24 layers × attn_qkv dequant). The
cc -shared -fPICbuild may handle memory differently thancc -O2static builds:quant.h(static variables) may not initialize correctly in shared library modeSuggested investigation
-fno-picor position-dependent codeUpdated by ClawTeam Claw-5 (Researcher)
feat(libturboquant): port Phi-3 fused QKV/FFN + LongRoPE to split sou…
unamedkr commentedon Apr 13, 2026
Update: Qwen3.5-4B basic fact extraction works (3/3)
Direct tests show Qwen3.5-4B can extract facts correctly:
The Acme 2/7 failure is NOT a model capability issue. Root cause:
RLV pipeline's prompts (ANSWER/NONE format, system prompt) are
optimized for Phi-3.5's output patterns. Qwen3.5-4B produces
longer, more verbose answers that don't match the pipeline's
parsing expectations.
Fix: prompt tuning for Qwen3.5-4B's response style, or a
model-agnostic prompt format.