Skip to content

Fix/pin peft version - #826

Open
MN-NR wants to merge 3 commits into
meta-pytorch:mainfrom
MN-NR:fix/pin-peft-version
Open

Fix/pin peft version#826
MN-NR wants to merge 3 commits into
meta-pytorch:mainfrom
MN-NR:fix/pin-peft-version

Conversation

@MN-NR

@MN-NR MN-NR commented Jun 1, 2026

Copy link
Copy Markdown

Type of change

  • Docs change / refactoring

Motivation and Context / Related issue

Fixes #820

peft 0.14+ breaks Opacus hook registration when used with LoRA (see
issue #820 for full root cause analysis and reproducer). The tutorial
currently does not pin a peft version, causing users to silently
install an incompatible version and hit the bug.

This commit pins peft==0.13.2 in the LoRA tutorial as suggested by
@iden-kalemaj in issue #820, until full compatibility with peft 0.14+
is restored.

Changes

  • Added !pip install peft==0.13.2 cell in
    tutorials/building_text_classifier.ipynb before the LoRA section

How Has This Been Tested

Verified peft==0.13.2 imports and LoRA setup works correctly locally:

  • PyTorch 2.11.0, Python 3.10
  • Full notebook not re-run (training takes too long)

MN-NR added 3 commits April 9, 2026 18:50
When DataLoader uses WeightedRandomSampler, sample_rate was incorrectly
computed from len(data_loader) instead of the true dataset size, causing
privacy budget to burn 100x-1000x faster than expected.

Fixed by capturing dataset size and batch_size before _prepare_data_loader()
replaces the sampler, ensuring privacy accounting uses actual dataset size.

Fixes #[813]"
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 1, 2026
@meta-codesync

meta-codesync Bot commented Jun 1, 2026

Copy link
Copy Markdown

This pull request has been imported. If you are a Meta employee, you can view this in D107026628. (Because this pull request was imported automatically, there will not be any future comments.)

@iden-kalemaj

Copy link
Copy Markdown
Contributor

@MN-NR before landing this, can you please check my comment in #820?

@iden-kalemaj

Copy link
Copy Markdown
Contributor

@MN-NR also this commit's changes seem to have been merged with another commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Silent corrupted LoRA weight updates with Opacus 1.5.4 + PEFT 0.18.x: training appears normal but models are unusable

2 participants