Repository navigation
vulkan_tf: refuse a model_type the engine does not know (fixes #6298) - #6325
devopsfortunato wants to merge 4 commits into
Conversation
Synthena Initial Review — Initial diff check passed (awaiting device run) (
|
|
Review at 1. A table-driven test over the full recognized set — every string that parsed yesterday still parses today, one line each — would catch this class directly; the new test only covers 2. The refusal doesn't name the type. |
|
Head |
|
Thanks @devopsfortunato. The core refusal is right: an unrecognised Two small things are left, and we will do them ourselves on top of your commit:
No change is needed from you.
|
|
One gap worth closing before this lands: |
The architecture came from a chain of model_type comparisons whose last arm was `.qwen35_hybrid`, so any unrecognised type (qwen4_moe today, qwen4_exp or qwen3_8 tomorrow) parsed without error and was mapped against the Qwen3.5 hybrid layout. The failure then surfaced downstream as a missing tensor, a wrong dimension or garbage output instead of "this model type is not supported". `.qwen35_hybrid` is now taken only by `qwen3_5` and the qwen3.5 MoE family; every other type falls through to `error.UnsupportedModelType`. The absent-key default is unchanged (`qwen3_5`), and every type the file already recognised still parses to the same architecture. The test parses the known llama config as `.qwen2_dense` and the same config with `model_type: "qwen4_moe"` expecting `error.UnsupportedModelType`. Fixes ashhart#6298.
qwen3_5_text is a real root-level model_type for the Qwen3.5 dense text model, and the parser served it as a Qwen3.5 hybrid before unknown types were refused. It now sits in the recognised Qwen3.5 arm, so it still parses. A refused config logs the model_type it carried, and whether it came from text_config, before returning UnsupportedModelType. A table test parses every model_type string the parser compares against, at the root and under text_config, and checks the architecture each one parsed to before; the published Ergo sample and a config with no model_type keep theirs. An unknown type under text_config is refused as at the root.
8650c77 to
e7e5633
Compare
`is_qwen35` matched `qwen3_5` and `qwen3_5_text` exactly, so a real Qwen3-VL checkpoint, whose text tower names `qwen3_vl_text` or `qwen3_5_vl_text`, was refused by the new model_type gate. The check now contains-matches `qwen3_5` and `qwen3_vl`, as `vision_config.zig` already does, with a test for both tower spellings.
|
Thanks @devopsfortunato. The supplied head includes the dense and VL aliases, the recognized-type table, and a refusal log naming the offending type. The earlier asks are met. We will tighten the remaining type guard and add its regression ourselves before landing. No further revision is needed from you. These parser checks do not require a Vulkan device run.
|
An unknown model_type that only contains a familiar family name (unknown_qwen3_5, qwen3_5_future) is refused instead of served as a Qwen3.5 hybrid. Every published type stays accepted: qwen3_5 and _text, the VL and VL-MoE names and their _text forms, and the MoE names.
|
READY to land on this head. Reviewed with our follow-up commit: unknown model types now stop at load with a clear message, and every published config the engine serves is still admitted; host tests and the checks finished on this head pass. The landing train runs the device cells.
|
What this changes
bf1a2eb22): one commit plus the changelog line.atc overlap --json: 2 changed files underengines/vulkan_tf/src/, no overlap with open PRs.Before:
engines/vulkan_tf/src/config_json.zigderived the architecture from a chain ofmodel_typecomparisons whose last arm was.qwen35_hybrid, so any unrecognised type parsed without error and was then mapped against the Qwen3.5 hybrid layout —qwen4_moe(public since 2026-12-03) does today. The failure surfaced later as a missing tensor, a wrong dimension or garbage output.After:
.qwen35_hybridis taken only byqwen3_5and the qwen3.5 MoE family (qwen3_5_moe[_text],qwen3_next,qwen3_6_moe[_text]); every other type falls through toerror.UnsupportedModelType. The absent-key default staysqwen3_5, and every type the file recognised before still maps to the same architecture.Checks on this head
zig build testinengines/vulkan_tf(host tests, no Vulkan device): passes, including the new check (known llama config →.qwen2_dense; the same config withmodel_type: "qwen4_moe"→error.UnsupportedModelType).zig fmt --checkon both changed files: clean.zig build test test-goldendoes not build this engine; CI covers the rest.Receipt