Skip to content

Pin Accelerate below 1.14 for llm_qat - #2067

Merged
kevalmorabia97 merged 2 commits into
mainfrom
asma/pin-accelerate-llm-qat-fsdp2
Aug 5, 2026
Merged

kevalmorabia97 merged 2 commits into
mainfrom
asma/pin-accelerate-llm-qat-fsdp2

Conversation

@realAsma

@realAsma realAsma commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Type of change: Bug fix

Pins Accelerate below 1.14 for the llm_qat example. Accelerate 1.14 introduced an FSDP2 regression for models whose input embeddings and output head share a parameter; the shared weight can be assigned to two FSDP groups and training fails before the first step.

The pin is example-local. The project-wide Hugging Face dependency range and unrelated examples remain unchanged.

Usage

No usage change. Installing the llm_qat requirements now resolves Accelerate to the existing supported range below 1.14.

Testing

  • Reproduced the duplicate shared-parameter FSDP2 failure with Accelerate 1.14.0 on two ranks.
  • Verified Accelerate 1.13.0 completes a distillation training step with the otherwise-identical environment and a clean main source tree.
  • Verified the combined requirements resolve to accelerate>=1.0.0,<1.14 and select 1.13.0.
  • pre-commit run --files examples/llm_qat/requirements.txt
  • git diff --check

Before your PR is "Ready for review"

Make sure you read and follow Contributor guidelines and your commits are signed (git commit -s -S).

Make sure you read and follow the Security Best Practices.

  • Is this change backward compatible?: ✅
  • If you copied code from any other sources or added a new PIP dependency, did you follow guidance in CONTRIBUTING.md: N/A
  • Did you write any new necessary tests?: N/A — dependency-only change validated by an exact two-rank A/B run.
  • Did you update Changelog?: N/A
  • Did you get Claude approval on this PR?: ❌ — draft PR; automated review is pending.

Additional Information

This is a scoped compatibility pin while the upstream Accelerate regression remains unresolved.

Summary by CodeRabbit

  • Chores
    • Constrained the Accelerate dependency to versions below 1.14 to improve compatibility for the LLM question-answering example.

@copy-pr-bot

copy-pr-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 3b798c4c-4a41-4bb5-825f-22b2161b8962

📥 Commits

Reviewing files that changed from the base of the PR and between 8c16bf1 and d2d27a9.

📒 Files selected for processing (1)
  • examples/llm_qat/requirements.txt
🚧 Files skipped from review as they are similar to previous changes (1)
  • examples/llm_qat/requirements.txt

📝 Walkthrough

Walkthrough

The LLM QAT example documents an Accelerate regression and requires accelerate<1.14.

Changes

LLM QAT dependency constraint

Layer / File(s) Summary
Accelerate requirement update
examples/llm_qat/requirements.txt
The requirements file documents an Accelerate regression and constrains the dependency to versions below 1.14.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: kevalmorabia97

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the dependency pin added to the llm_qat example.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Security Anti-Patterns ✅ Passed The PR only tightens the existing accelerate requirement from <1.14 to >=1.0.0,<1.14; it adds no dependency or Python security-sensitive code.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch asma/pin-accelerate-llm-qat-fsdp2

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.95%. Comparing base (2d4be28) to head (d2d27a9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2067      +/-   ##
==========================================
+ Coverage   65.45%   66.95%   +1.49%     
==========================================
  Files         521      521              
  Lines       59857    59857              
==========================================
+ Hits        39181    40077     +896     
+ Misses      20676    19780     -896     
Flag Coverage Δ
examples 43.04% <ø> (+2.08%) ⬆️
unit 55.38% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@realAsma
realAsma marked this pull request as ready for review August 4, 2026 22:54
@realAsma
realAsma requested a review from a team as a code owner August 4, 2026 22:54
@realAsma
realAsma requested a review from kevalmorabia97 August 4, 2026 22:54

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.

Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.

👉 Steps to fix this

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/llm_qat/requirements.txt`:
- Line 2: Update the accelerate requirement in requirements.txt to include the
lower bound >=1.0.0 while preserving the existing upper bound <1.14, ensuring
standalone installations cannot select Accelerate 0.x.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 94e1d4f9-7dad-4e24-8868-52e63f99a7da

📥 Commits

Reviewing files that changed from the base of the PR and between 2d4be28 and 8c16bf1.

📒 Files selected for processing (1)
  • examples/llm_qat/requirements.txt

Comment thread examples/llm_qat/requirements.txt Resolved
@kevalmorabia97
kevalmorabia97 merged commit fed1980 into main Aug 5, 2026
47 checks passed
@kevalmorabia97
kevalmorabia97 deleted the asma/pin-accelerate-llm-qat-fsdp2 branch August 5, 2026 03:49
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-05 03:49 UTC

@kevalmorabia97 kevalmorabia97 added the cherry-pick-done Added by bot once PR is cherry-picked to the release branch label Aug 5, 2026
kevalmorabia97 pushed a commit that referenced this pull request Aug 5, 2026
### What does this PR do?

Type of change: Bug fix

Pins Accelerate below 1.14 for the `llm_qat` example. Accelerate 1.14
introduced an FSDP2 regression for models whose input embeddings and
output head share a parameter; the shared weight can be assigned to two
FSDP groups and training fails before the first step.

The pin is example-local. The project-wide Hugging Face dependency range
and unrelated examples remain unchanged.

### Usage

No usage change. Installing the `llm_qat` requirements now resolves
Accelerate to the existing supported range below 1.14.

### Testing

- Reproduced the duplicate shared-parameter FSDP2 failure with
Accelerate 1.14.0 on two ranks.
- Verified Accelerate 1.13.0 completes a distillation training step with
the otherwise-identical environment and a clean `main` source tree.
- Verified the combined requirements resolve to
`accelerate>=1.0.0,<1.14` and select 1.13.0.
- `pre-commit run --files examples/llm_qat/requirements.txt`
- `git diff --check`

### 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).

- Is this change backward compatible?: ✅
- If you copied code from any other sources or added a new PIP
dependency, did you follow guidance in `CONTRIBUTING.md`: N/A
- Did you write any new necessary tests?: N/A — dependency-only change
validated by an exact two-rank A/B run.
- Did you update
[Changelog](https://github.com/NVIDIA/Model-Optimizer/blob/main/CHANGELOG.rst)?:
N/A
- Did you get Claude approval on this PR?: ❌ — draft PR; automated
review is pending.

### Additional Information

This is a scoped compatibility pin while the upstream Accelerate
regression remains unresolved.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Constrained the Accelerate dependency to versions below 1.14 to
improve compatibility for the LLM question-answering example.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: realAsma <[email protected]>
kevalmorabia97 added a commit that referenced this pull request Oct 26, 2026
### What does this PR do?

Type of change: Bug fix

Raises the `llm_qat` example's accelerate requirement from
`>=1.0.0,<1.14` to `>=1.15.0`. The `<1.14` cap (#2067) existed because
accelerate 1.14.0 broke FSDP2 for models with tied input/output
embeddings. 1.15.0 fixes that, and it also moves the example off
accelerate versions affected by CVE-2026-69112 (path traversal in
`load_checkpoint_in_model` / `load_checkpoint_and_dispatch` via
unsanitized sharded-index `weight_map` entries). `uv.lock` already
resolves accelerate 1.15.0.

CI's tiny Qwen3 is untied, so it could not catch the 1.14 regression.
The shared NVFP4 PTQ student for the QAT/QAD tests is now built from a
tied-embedding tiny Qwen3 (`tied_qwen3_path`), so the existing tests
cover it with no extra runs.

### Usage

No usage change.

### Testing

In `nvcr.io/nvidia/pytorch:26.07-py3` (the llm_qat CI image) on 2 GPUs,
installed as CI does, running `pytest tests/examples/llm_qat -k fsdp2`:

- accelerate 1.14.0: `test_qwen3_qat_nvfp4[fsdp2]` and
`test_qwen3_qad_nvfp4[fsdp2]` **fail** (`ValueError: Parameter
'model.embed_tokens.weight' is shared with a parameter already managed
by another FSDP group`).
- accelerate 1.15.0: both pass.

Not run: the `ddp` / `deepspeed` backends (nightly) and the rest of the
llm_qat tests.

### Before your PR is "*Ready for review*"

- Is this change backward compatible?: ✅ (example-local requirement
bump)
- If you copied code from any other sources or added a new PIP
dependency, did you follow guidance in `CONTRIBUTING.md`: N/A
- Did you write any new necessary tests?: ✅ (existing QAT/QAD tests now
use a tied-embedding model)
- Did you update
[Changelog](https://github.com/NVIDIA/Model-Optimizer/blob/main/CHANGELOG.rst)?:
N/A
- Did you get Claude approval on this PR?: N/A

### Additional Information

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Chores**
  * Updated the minimum required Accelerate version.
* **Tests**
* Expanded validation of quantization-aware workflows with models that
use tied word embeddings. The updated checks also confirm that the model
fixture remains unchanged during testing.

These changes update a package requirement and internal test coverage;
no new end-user functionality is noted.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Keval Morabia <[email protected]>
Co-authored-by: Claude Sonnet 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick-done Added by bot once PR is cherry-picked to the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants