perf([ref-watch-phosphene-pin-mlx-lazy-eval-cadence-envs]): pin MLX lazy-eval cadence to =1 for ~25x faster LTX-2 denoise#520
Merged
atomantic merged 1 commit intoMay 29, 2026
Conversation
…azy-eval cadence to =1 for ~25x faster LTX-2 denoise
Phosphene's M4 Max 64 GB I2V Balanced 5s / 121 f matrix:
LTX2_DIT_EVAL_EVERY=8 (upstream default): ~3 min/step
LTX2_DIT_EVAL_EVERY=1: ~7 s/step (~25x faster)
LTX2_DIT_EVAL_EVERY=0: also fast, but extends the post-decode
deallocator hang the prior commit (os._exit(0)) mitigates.
=1 wins on both axes (denoise speed + clean shutdown). The existing
defense-in-depth os._exit(0) at helper teardown stays in place.
Also flips LTX2_GEMMA_EVAL_EVERY to match. Both still use setdefault
so a caller-supplied env var overrides.
Contributor
There was a problem hiding this comment.
Pull request overview
Changes the default MLX lazy-eval cadence env vars in the LTX-2 helper from 0 to 1 to retain the ~25× denoise speedup over the upstream =8 default while avoiding the post-decode deallocator hang associated with =0. Comment, PLAN entry, and changelog updated accordingly.
Changes:
- Bump
LTX2_DIT_EVAL_EVERY/LTX2_GEMMA_EVAL_EVERYdefaults0→1inscripts/generate_ltx2.py(with updated rationale comment). - Remove completed PLAN item for this slug.
- Add changelog entry under Next.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| scripts/generate_ltx2.py | Pin lazy-eval cadence envs to =1 before LTX imports |
| PLAN.md | Drop the now-shipped planning entry |
| .changelog/NEXT.md | User-facing note for faster LTX-2 renders |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Bumps
LTX2_DIT_EVAL_EVERYandLTX2_GEMMA_EVAL_EVERYfrom0→1inscripts/generate_ltx2.py. These envs govern lazy MLX graph-eval cadence on M-series Macs and must be set before anyltx_core_mlximport (the transformer module reads them at import time).Phosphene's published M4 Max 64 GB I2V Balanced 5s / 121 f matrix shows:
=8(upstream default)=1(this PR)=0(prior PortOS value)=1wins on both axes: full denoise speedup + clean shutdown. The defense-in-depthos._exit(0)added in0f5b7384stays in place either way.setdefaultis preserved so a caller-supplied env var still wins.Test plan
=1interacts with the same post-decode hang[ref-watch-phosphene-sigkill-watchdog-videogen-local]plans to defense-in-depth; not autonomously verifiable without a real Apple Silicon Mac)scripts/generate_ltx2.py:53-54reach the child process (the helper's stderr should NOT mention any upstream "lazy-eval disabled" warning)Slug:
[ref-watch-phosphene-pin-mlx-lazy-eval-cadence-envs]