Recover: compact per-token timestep for conditioned denoising#18
Merged
Conversation
With prefix conditioning the per-token video timestep takes exactly two values (t for free tokens, 0 for conditioned), but materializing it per token cost ~1GB of temb plus ~1GB of per-block modulation transients at 13500 tokens -- enough to OOM the chained 960x960x113f render that the 12600-token i2v render squeaked past. The transformer now takes cond_token_index alongside a 2-entry timestep: the compiled stack's new modtok() selects each modulation vector per token on demand (one ~110MB slice at a time), the eager fallback expands temb up front as before, and the output layer expands embedded_timestep on either path. Parity test ties the compact representation to the eager per-token expansion at 1e-4.
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.
Recovers a commit that was in the working tree but unpushed when #16 was squash-merged (session restarts interrupted between commit and push). It is the memory fix that makes chained continuation renders fit on 16GB: the conditioned per-token timestep takes exactly two values, so the transformer takes a 2-entry timestep + per-token index and the JIT stack selects modulation slices on demand instead of materializing ~2GB. Parity-tested; the chain render validated end to end on this code.