fix: clamp interactive num_latent_chunk to max(cumulative), not sum - #137
Open
smcshahid wants to merge 1 commit into
Open
fix: clamp interactive num_latent_chunk to max(cumulative), not sum#137smcshahid wants to merge 1 commit into
smcshahid wants to merge 1 commit into
Conversation
interpolate_cumulative_list is already cumulative (itertools.accumulate of interpolate_time_list). When the requested chunk count is below the schedule, the intended clamp is the schedule's end - max(...). sum(...) over an already-cumulative list grows quadratically in prompt count: with the shipped example CSV (6 prompts x 7 chunks) a 693-frame request becomes 147 chunks (4,851 frames, ~3.4 min of video) and then OOMs at postprocess on an 80 GB H100. Requests >= the schedule length are unaffected (the branch never fires), which is why the official 1,452-frame example script masks the bug. Co-Authored-By: Claude Fable 5 <noreply@anthropic.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
One-line fix: the interactive-mode chunk-count clamp uses
sum(interpolate_cumulative_list)where the intent ismax(...).interpolate_cumulative_listis already cumulative (itertools.accumulateofinterpolate_time_list). When the requestednum_framesis below the schedule's end, summing the cumulative list grows quadratically in prompt count: with the bundled example CSV (6 prompts × 7 chunks → cumulative[7,14,21,28,35,42]) a 693-frame request becomes 147 chunks = 4,851 frames (~3.4 min of video), which then OOMs atpostprocess_videoon an 80 GB H100. Because the CLI batch loop swallows exceptions, the process exits 0 with no output.Fixes #136
Compatibility / regression
max(cumulative)chunks — exactly enough for every prompt interval).🤖 Generated with Claude Code