feat: support Wan2.2 VACE - #2062
Merged
Merged
Conversation
- route GGUFs declaring >4-dim tensors to the extended reader instead of gguf_init_from_file, which rejects them with a misleading ERROR - fix the extended reader's ARRAY metadata parsing: elements are raw values, not key-value entries - document Wan2.2 VACE-Fun A14B (MoE expert pair) and add a sample clip
Owner
|
I’ve updated the PR title to use fix:. Wan2.2 VACE is already supported by the existing implementation; this PR fixes GGUF metadata parsing, avoids misleading errors when loading five-dimensional tensors, and adds usage documentation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Issue #1953 asked about Wan2.2 VACE. Testing showed the existing VACE path already handles the new checkpoints correctly once they are loaded — the real obstacles were two problems in the GGUF reading path:
1. Misleading errors when loading >4-dim tensors. Wan2.2 GGUFs (QuantStack) store conv3d weights as 5-dim tensors (
patch_embedding.weight,vace_patch_embedding.weight).gguf_init_from_filerejects them withinvalid number of dimensions: 5 > 4and logs an ERROR, even though the extended reader folds them correctly — which made these models look unsupported. Wan2.1_14B_VACE and Wan2.2-T2V GGUFs carry the same 5-dim tensors, so this affects the whole Wan 14B family.2. A latent bug in the extended reader's ARRAY metadata parsing. It read each array element as a full key-value pair, but GGUF array elements are raw values (no key/type headers). Any file with array-typed metadata (e.g. the ~32k tokenizer vocabulary in umt5-xxl-encoder) fails in that path — which went unnoticed because the extended reader only runs as a fallback.
Changes:
gguf_reader_ext.h: parse ARRAY metadata by element type (fixed-size seeks / per-string skips); addhas_tensors_beyond_ggml_limits().gguf_io.cpp: do a cheap header scan first; files declaring >4-dim tensors go straight to the extended reader instead of callinggguf_init_from_file, which is guaranteed to fail. All other files keep the existing behavior (gguf first, reader as fallback).Also added a
docs/wan.mdsection for Wan2.2 VACE-Fun A14B (MoE expert pair usage) and a generated sample clip.Related Issue / Discussion
Fix #1953.
Additional Information
Verified locally on an RTX 5070 Ti (CUDA):
assets/wan/), T2V runs cleanlyNot covered: Vulkan backend (the code path is backend-agnostic; the issue reporter offered to verify), V2V control video (shares the Wan2.1 VACE path).
Checklist