Repository navigation
[NVBug 6982528] Save LTX full-mode checkpoints as safetensors - #3015
Conversation
Signed-off-by: yingguo-trt <[email protected]>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Save checkpoints with safe serialization examples/diffusers/distillation/distillation_trainer.py, CHANGELOG.rst |
The non-LoRA checkpoint save call enables safe serialization. The changelog records the LTX-2 full-mode checkpoint format fix. |
Priority:
Estimated code review effort: 1 (Trivial) | ~5 minutes
Change: Bug fix
Suggested reviewers: kevalmorabia97, mxino
Merge Risk: 
Minimal · up to 80eca
-
The changelog entry is in the intended release section. No actionable merge-blocking issue remains after normal checks.
Pre-merge checks: 
6
-
Full details: Title check
-
Explanation
The title "[NVBug 6982528] Save LTX full-mode checkpoints as safetensors" matches the main change. The PR passes safe_serialization=True to Accelerator.save() for LTX-2 distillation full-mode checkpoints, so the saved files match their .safetensors extension. The bug tracker prefix is extra detail but does not make the title misleading. The title is specific and short, so it passes.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)
Full details: Security Anti-Patterns
-
Explanation
PASS. The PR changes only CHANGELOG.rst and one call in examples/diffusers/distillation/distillation_trainer.py. The code change adds safe_serialization=True to Accelerator.save(); it adds no torch.load(..., weights_only=False), pickle-enabled NumPy load, hardcoded trust_remote_code=True, input-driven eval()/exec(), or # nosec. No dependency manifest changes were made.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3015 +/- ##
=======================================
Coverage 77.51% 77.51%
=======================================
Files 661 661
Lines 74937 74937
=======================================
Hits 58086 58086
Misses 16851 16851
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: yingguo-trt <[email protected]>
What does this PR do?
Type of change: Bug fix.
LTX-2 distillation with
training_mode: fullnames its standalone weights.safetensors, butAccelerator.save()defaults to PyTorch serialization. Loading that file with safetensors fails withError while deserializing header: header too large.Pass
safe_serialization=Trueso the saved contents match the advertised format, and document the fix in the changelog.Usage
No configuration changes are required. Full-mode training now writes valid safetensors weights. Existing incorrectly serialized files are not converted.
Testing
test_ltx_full_checkpoint_is_safetensors; no new tests added. It executes the production save method extracted unchanged from the example, with a tiny CPU model and real Accelerate/safetensors APIs. The baseline fails with the header error; the fix passes with exact key and BF16 tensor equality. This is method-level validation, not a full LTX training run.git diff --checkpass. The mypy hook environment passes with--platform linux; the pre-existing Windowsos.sched_getaffinityerror also reproduces on the unmodified source and was excluded.Before your PR is "Ready for review"
CONTRIBUTING.md: N/A.Additional Information
NVBug 6982528.
Summary by CodeRabbit