You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(ltx2): implement centralized, configuration-driven logical sharding strategy for LTX-2 and LTX-2.3
- Created logical sharding spec registry (logical_sharding_ltx2.py) with profiles for Ironwood (1D head-wise sharding) and Trillium (2D sharding).
- Parameterized all previously hardcoded sharding specs in LTX2 transformer, attention, AdaLN, VAE timestep embeddings, and connector layers.
- Added explicit strategy configuration checks inside the registry factory; unknown strategy names now log a clear warning and gracefully fall back to the highly compatible "trillium" profile to prevent configuration typos from crashing or silently degrading performance.
- Parameterized the Feed Forward Network (NNXSimpleFeedForward) and Timestep/Text Embedding models, cleanly decoupling shared layers from LTX2-specific spec files using dynamic duck typing (safe_getattr fallback logic).
- Created a robust, central helper utility (safe_getattr in max_utils.py) to safely query properties on specs objects, completely preventing AttributeError crashes when models are instantiated directly using default parameters (sharding_specs = None).
- Resolved circular import dependencies between model modules (attention_flax.py) and standard utilities (max_utils.py) by moving internal model lookups (AttentionOp) inside floating-point operations helpers (calculate_model_tflops) to load lazily, ensuring system-wide runtime stability.
- Refactored the config object in the LTX2 pipeline constructor so that dynamic runtime spec properties (self.te_specs and self.vae_specs) are resolved once on pipeline instantiation and stored as cached attributes, accelerating inference step runs and preventing redundant static specs recalculations.
- Parameterized pipeline-level text encoder execution choices (use_batched_text_encoder) to be fully driven by the centralized sharding registry specs.
- Replaced hardcoded pipeline-level VAE replication with a configuration-driven force_replication spec.
- Cleanly integrated newly merged LTX-2.3 features (like gated attention) into the centralized sharding system.
- Added logical sharding configuration structures, text_encoder_dtype, compile_text_encoder, and base_output_directory to LTX-2 (ltx2_video.yml) and LTX-2.3 (ltx2_3_video.yml) configs.
- Added configuration support for text_encoder_dtype and compile_text_encoder in LTX2 / LTX2.3 pipelines to resolve and compile the text encoder dynamically.
- Parameterized the config object in the LTX2 pipeline constructor so that standard properties (such as sharding profiles) can be passed directly upon pipeline instantiation.
- Added logical sharding factory unit tests.
- Updated pipeline unit tests to cleanly utilize default/unbatched configuration profiles, asserting the correct fallback and execution counts.
TAG=agy
0 commit comments