fix(dream): add QKV bias support for Qwen2.5 backbone

Dream/Qwen2.5 uses biases on Q, K, V projections. Without them,
attention is fundamentally incorrect producing garbage output.

Changes:
- diffuse_layer: add optional bq, bk, bv bias tensor pointers
- diffuse-model: load bias tensors from GGUF (nullptr if absent)
- diffuse-graph: apply ggml_add after QKV projection in all 3 graph builders
- convert-dream.py: include QKV bias tensors instead of skipping them

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
iafiscal1212andClaude Opus 4.6 committed 2026-03-22 13:28:50 +01:00
1 parent 3f6aa5597a
commit 531ef58222
4 files changed
+32 -1

No files matched your search

+5
View File
@@ -36,6 +36,11 @@ struct diffuse_layer {
struct ggml_tensor * wv; // V projection
struct ggml_tensor * wo; // output projection
// QKV biases (optional, nullptr for models without them e.g. LLaDA)
struct ggml_tensor * bq = nullptr; // Q bias (Dream/Qwen2.5)
struct ggml_tensor * bk = nullptr; // K bias
struct ggml_tensor * bv = nullptr; // V bias
// FFN (SwiGLU)
struct ggml_tensor * ffn_norm; // RMSNorm weight
struct ggml_tensor * ffn_gate; // gate projection (w1)