fix: ping peft >= 0.18.0, < 0.19.0 for torchao compatability issues#630
fix: ping peft >= 0.18.0, < 0.19.0 for torchao compatability issues#630davidberenstein1957 merged 2 commits intomainfrom
peft >= 0.18.0, < 0.19.0 for torchao compatability issues#630Conversation
Up to standards ✅🟢 Issues
|
b133bca to
3fdd1a1
Compare
begumcig
left a comment
There was a problem hiding this comment.
Thanks for the PR @davidberenstein1957
I think we currently don’t support torchao > 0.16. When we tested newer versions, our nightlies started failing (@gsprochette would know better about this than me), so we still need to properly investigate compatibility. Also even if we supported the newer torchao, pinning it >=0.16.0 would break the torch versions we support, because they are also tightly coupled.
From my perspective, the next steps would be:
- Investigate whether we can support torchao > 0.16.
- Introduce a new extra (aligned with our dependency separation strategy in Pruna), e.g. recovery, that includes the required versions for peft, trl, termcolor, and torchao. We should also guard all module-level imports of these packages across the codebase (tests and recovery).
Since the nightlies are currently failing and we need a quick fix, I think we can temporarily pin peft to:
peft >= 0.18.0, < 0.19.0
In the PR description, you mentioned that the issue comes from peft>=0.18.1, but after checking the source code, it looks like the breaking change was actually introduced in 0.19.0:
https://github.com/huggingface/peft/blob/6d5a6f4f2f902dbf13d21d2661d57c3c05df1dae/src/peft/import_utils.py#L131
Please correct me if I’m mistaken here.
But anyway, I think overall, pinning peft to a version range above 0.18.0 and below the first version that introduces the torchao incompatibility should be a reasonable short-term fix, until we can properly support newer torchao versions. What do you think?
|
Hi @begumcig, I have not investigated the nightlies. @gsprochette is still on holiday, right? Let's, for now, go for the easy fix and pin peft to |
bd61900 to
57a023d
Compare
Made-with: Cursor
peft >= 0.18.0, < 0.19.0 for torchao compatability issues
225df80 to
ae645b8
Compare
begumcig
left a comment
There was a problem hiding this comment.
Looks super good to me !! Thank you so much David
Summary
peft>=0.18.1added a strictis_torchao_available()check that raisesImportError(not returnsFalse) whentorchao<0.16.0is installedHyperalgorithm onstable_diffusion_v1_4) — failing CI job: feat(evaluation): add VLMMetrics #545<0.16.0upper cap and raises the floor to>=0.16.0Root cause
Call chain:
Hyper._apply→model.load_lora_weights→ peftdispatch_torchao→is_torchao_available()→ImportError: Found version 0.15.0, but only versions above 0.16.0 are supportedThe original cap was added for a torchao+torch_compile+diffusers interaction. That issue is CPU/torch_compile-specific and does not affect the base test suite. torchao 0.17.0 Python API is compatible with
torch>=2.8.0(our CI uses torch 2.9.1).Test Plan
test (3.11, base)passes — specificallyTestHyper_stable_diffusion_v1_4-cpuTestTorchao_sd_tiny_random-cpuandTestTorchao_flux_tiny_random-cpustill pass