refactor: rename LTX_MEGACACHE_* env to generic DI_MEGACACHE_* (backward-compat)#13
Open
Johan-de-R wants to merge 1 commit into
Open
refactor: rename LTX_MEGACACHE_* env to generic DI_MEGACACHE_* (backward-compat)#13Johan-de-R wants to merge 1 commit into
Johan-de-R wants to merge 1 commit into
Conversation
…ard-compat) The compile-cache mechanism is torch.compiler Mega-Cache (save/load_cache_artifacts), a PyTorch-level portable-compile-cache that is NOT LTX-specific -- it is wired at the FastVideo gpu_worker level and applies to any video family (fastwan, ltx2, ltx23, ...). As we make it the default for our self-run video models, the LTX_-prefixed env name is misleading, so rename before it proliferates into more baked images: LTX_MEGACACHE_DIR -> DI_MEGACACHE_DIR LTX_MEGACACHE_BLOB -> DI_MEGACACHE_BLOB LTX_MEGACACHE_SAVE_EVERY -> DI_MEGACACHE_SAVE_EVERY Also renames patches/ltx23_gpu_worker_megacache.patch -> gpu_worker_megacache.patch and the private helper methods _ltx_megacache_* -> _megacache_*. Backward-compatible so nothing breaks mid-transition: - lib/pool.py reads `DI_MEGACACHE_DIR or LTX_MEGACACHE_DIR` and exports BOTH DI_MEGACACHE_BLOB and LTX_MEGACACHE_BLOB to the worker child. - the gpu_worker patch reads `DI_MEGACACHE_BLOB or LTX_MEGACACHE_BLOB` (and same for SAVE_EVERY). So already-baked images and any in-flight bakes that set LTX_MEGACACHE_DIR keep working. Drop the LTX_ fallbacks once every video image has been rebuilt on this change. Co-Authored-By: Claude Opus 4.8 <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
Renames the Mega-Cache env vars from the
LTX_-prefixed names to genericDI_-prefixed ones:LTX_MEGACACHE_DIRDI_MEGACACHE_DIRLTX_MEGACACHE_BLOBDI_MEGACACHE_BLOBLTX_MEGACACHE_SAVE_EVERYDI_MEGACACHE_SAVE_EVERYAlso renames
patches/ltx23_gpu_worker_megacache.patch→patches/gpu_worker_megacache.patchand the private helpers_ltx_megacache_*→_megacache_*.Why
The mechanism is torch.compiler Mega-Cache (
save/load_cache_artifacts) — a PyTorch-level portable compile-cache wired at the FastVideogpu_workerlevel. It is not LTX-specific; it works for any video family (fastwan, ltx2, ltx23, …). We're moving to enable it by default on our self-run video models, so theLTX_name is misleading. Renaming now, before it gets baked into more images.Backward compatibility (no breakage mid-transition)
lib/pool.pyreadsDI_MEGACACHE_DIR or LTX_MEGACACHE_DIR, and exports bothDI_MEGACACHE_BLOBandLTX_MEGACACHE_BLOBto the worker child.gpu_workerpatch readsDI_MEGACACHE_BLOB or LTX_MEGACACHE_BLOB(and same forSAVE_EVERY).So already-baked images and any in-flight LTX-2.3 bakes that set
LTX_MEGACACHE_DIRkeep working. Drop theLTX_fallbacks in a follow-up once every video image has been rebuilt on this change.Coordination
Touches shared
lib/pool.py+ the gpu_worker patch, which the LTX-2.3 speed ship (#12, merged) also uses. Backward-compat means no action required from that thread; adoptDI_MEGACACHE_DIRat the next LTX image rebuild.Validation
black/isortclean onlib/pool.py.+) lines; hunk line-count unchanged, sogit applybehavior is identical to before.🤖 Generated with Claude Code