fix(vace): stop firstlastframe log flood with config validation flag#687
fix(vace): stop firstlastframe log flood with config validation flag#687livepeer-tessa wants to merge 1 commit intomainfrom
Conversation
When num_frame_per_block=1 is used with firstlastframe mode the validation check in _build_extension_frames_and_masks fires on every chunk (~50ms intervals), producing ~700 identical ERROR log lines in a 22-second session window. Fix with two changes: 1. Early validation in _encode_extension_mode — checks the num_frame_per_block constraint up-front (before the deep tensor build path) and emits a clear, actionable error message that names the config knob and suggests alternatives. 2. _config_validation_error flag — when the validation fails the flag is set on the block instance. __call__ checks the flag at entry and returns early (vace_context=None) for all subsequent chunks, so only the first occurrence reaches the log as an ERROR. The flag is reset by clear_encoder_caches() so a new session with corrected config works normally. The redundant ValueError in _build_extension_frames_and_masks is converted to an assert; it now serves as a safety net for callers that bypass the public __call__ path. Fixes #685 Related: #673 (same per-chunk flood pattern, vace_encoding) Signed-off-by: livepeer-robot <robot@livepeer.org>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment Tip You can disable the changed files summary in the walkthrough.Disable the |
🚀 fal.ai Preview Deployment
TestingConnect to this preview deployment by running this on your branch: 🧪 E2E tests will run automatically against this deployment. |
✅ E2E Tests passed
Test ArtifactsCheck the workflow run for screenshots. |
Problem
VaceEncodingBlockinfirstlastframemode raises aValueErroron every processed chunk whennum_frame_per_block=1. SinceValueErroris treated as recoverable bypipeline_processor, the pipeline keeps running and re-fires the same error every ~50ms — producing ~700 identical ERROR log lines in a 22-second session window.Root: the check lived deep inside
_build_extension_frames_and_masks, which is called per-chunk with no gate to short-circuit once a config error is known.Fixes #685
Changes
1. Early validation in
_encode_extension_mode(before the tensor-build path)num_frame_per_block >= 2forfirstlastframemode at the start of each encoding callfirstframe/lastframewith a single ref image)2.
_config_validation_errorflag on the block instance__call__checks the flag at entry; if set, returns early withvace_context=None(silent, DEBUG log)clear_encoder_caches()so a corrected config works normally in a new session3. Redundant
ValueError→assert_build_extension_frames_and_masksis converted to anassert; it is now dead code for callers going through__call__, but remains a safety net for direct callers.Behaviour After Fix
clear_encoder_caches)Related