fix(wan-audio): restore the phase argument at the three multi-line _apply_rope_with_cache_range call sites - #1460
Open
Anai-Guo wants to merge 1 commit into
Open
Conversation
…ee multi-line call sites PR ModelTC#1238 ("[refactor]: rope as module") added `phase` as the first parameter of WanAudioARTransformerInfer._apply_rope_with_cache_range and updated the two single-line call sites, but the three call sites written across multiple lines were missed. They still start the argument list with the tensor, so each one raises: TypeError: _apply_rope_with_cache_range() missing 1 required positional argument: 'local_per_frame' Signed-off-by: Anai-Guo <antai12232931@outlook.com>
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.
What
WanAudioARTransformerInfer.infer_self_attn_with_kvcachecallsself._apply_rope_with_cache_range(...)in five places. Three of them are missing thephaseargument, so they raise:Why it happened
#1238 "[refactor]: rope as module" added
phaseas the first parameter of the method (the body now needs it for
phase.causal_rope.apply_audio_cache):def _apply_rope_with_cache_range( self, + phase, x, freqs,The same commit updated the two call sites that fit on one line:
but the three call sites in the same method that are formatted across multiple lines
(
:406,:434,:448) were left as they were. They still pass the tensor first, whichlands in the
phaseslot and shifts every remaining argument by one.Impact
:434and:448are in the non-seq_parallelbranch — i.e. the plain single-GPUSeko-AR audio path — so it fails on the first block, every run.
:406is theseq_parallel and not replicated_ref_prefill+use_local_cache_ropebranch.Verification
No runtime here (no GPU), so I replayed the binding statically: parse the file, build a
stub from the real
ast.argumentsof the definition, andinspect.Signature.bindeach ofthe five call sites — with the two known-good sites as the control group.
Before:
After this patch all five bind cleanly.
phaseis already the first parameter of theenclosing
infer_self_attn_with_kvcache, so it is in scope at each site — this is purelyrestoring the argument the refactor intended.
ruff checkandruff format --check(pinnedv0.11.0, repopyproject.toml) pass.🤖 Generated with Claude Code