Skip to content

DFlash draft model fails to load: rope_theta moved into rope_parameters #121

Closed

Description

@solderzzc

The dflash-speculative-decoding CI job fails on every PR. With the download noise removed by #119, the cause is now a clean, deterministic decode error:

[SwiftLM] ⚠️  Failed to load DFlash draft model: keyNotFound(CodingKeys(stringValue: "rope_theta"))

The download reaches 100% first, so this is not a transport problem.

Cause

z-lab/Qwen3.5-4B-DFlash's config.json has no top-level rope_theta. It uses the newer nested form:

"rope_parameters": { "rope_theta": 10000000, "rope_type": "default" }

DFlashDraftModel's configuration requires the flat key:

// Sources/DFlash/DFlashDraftModel.swift:65
case ropeTheta = "rope_theta"

and rope_theta is non-optional, so decoding throws before the model loads. Sources/SwiftLM/DeepseekV3DFlash.swift:74 declares the same key and looks likely to hit this too, though I have not confirmed it against a checkpoint.

Suggested fix

Decode rope_theta from rope_parameters.rope_theta when the flat key is absent, keeping the flat key working for older checkpoints. Something like a custom init(from:) that tries the top-level key first, then the nested one, then falls back to the existing default.

The wider transformers ecosystem has been migrating rope settings into rope_parameters, so other configurations reading rope_theta, rope_scaling, or rope_type flatly are worth auditing at the same time.

Impact

dflash-speculative-decoding cannot pass until this is fixed. It is independent of #120 (Gemma 4 KV-shared layers), which blocks the three integration_matrix jobs — together they account for all four persistently red checks.

Environment: SwiftLM main after #119, macOS 26.5.2, M5 Pro.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions