Skip to content

Commit 812e8c6

Browse files
authored
Minor update on the LTX2 NVFP4 recipe (#1010)
### What does this PR do? Type of change: minor code change <!-- Use one of the following: Bug fix, new feature, new example, new tests, documentation. --> 1. Update the default calibration dataset for LTX_VIDEO_DEV and LTX2 from Gustavosta/Stable-Diffusion-Prompts to nkp37/OpenVid-1M, which provides video-specific captions better suited for video model calibration. 2. update the default recipe for ltx2: first 3 and last 3 layers stays at higher precision. ### Usage ### Testing <!-- Mention how have you tested your change if applicable. --> ### Before your PR is "*Ready for review*" Make sure you read and follow [Contributor guidelines](https://github.com/NVIDIA/Model-Optimizer/blob/main/CONTRIBUTING.md) and your commits are signed (`git commit -s -S`). Make sure you read and follow the [Security Best Practices](https://github.com/NVIDIA/Model-Optimizer/blob/main/SECURITY.md#security-coding-practices-for-contributors) (e.g. avoiding hardcoded `trust_remote_code=True`, `torch.load(..., weights_only=False)`, `pickle`, etc.). - Is this change backward compatible?: ✅ / ❌ / N/A <!--- If ❌, explain why. --> - If you copied code from any other sources or added a new PIP dependency, did you follow guidance in `CONTRIBUTING.md`: ✅ / ❌ / N/A <!--- Mandatory --> - Did you write any new necessary tests?: ✅ / ❌ / N/A <!--- Mandatory for new features or examples. --> - Did you update [Changelog](https://github.com/NVIDIA/Model-Optimizer/blob/main/CHANGELOG.rst)?: ✅ / ❌ / N/A <!--- Only for new features, API changes, critical bug fixes or backward incompatible changes. --> ### Additional Information <!-- E.g. related issue. --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated default dataset configuration for LTX-Video and LTX2 models. * Refined model filtering pattern for LTX-Video to support additional model components. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Jingyu Xin <jingyux@nvidia.com>
1 parent 2d7d1ec commit 812e8c6

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

examples/diffusers/quantization/models_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def get_model_filter_func(model_type: ModelType) -> Callable[[str], bool]:
151151
ModelType.FLUX_SCHNELL: _FLUX_BASE_CONFIG,
152152
ModelType.LTX_VIDEO_DEV: {
153153
"backbone": "transformer",
154-
"dataset": _SD_PROMPTS_DATASET,
154+
"dataset": _OPENVID_DATASET,
155155
"inference_extra_args": {
156156
"height": 512,
157157
"width": 704,
@@ -161,7 +161,7 @@ def get_model_filter_func(model_type: ModelType) -> Callable[[str], bool]:
161161
},
162162
ModelType.LTX2: {
163163
"backbone": "transformer",
164-
"dataset": _SD_PROMPTS_DATASET,
164+
"dataset": _OPENVID_DATASET,
165165
"inference_extra_args": {
166166
"height": 768,
167167
"width": 1280,

examples/diffusers/quantization/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def check_conv_and_mha(backbone, if_fp4, quantize_mha):
7070
def filter_func_ltx_video(name: str) -> bool:
7171
"""Filter function specifically for LTX-Video models."""
7272
pattern = re.compile(
73-
r".*(proj_in|time_embed|caption_projection|proj_out|patchify_proj|adaln_single).*"
73+
r".*(proj_in|time_embed|caption_projection|proj_out|patchify_proj|adaln_single|transformer_blocks\.(0|1|2|45|46|47)\.).*"
7474
)
7575
return pattern.match(name) is not None
7676

0 commit comments

Comments
 (0)