Skip to content

Revert xfail for MoE LoRA tests now that peft#3602 fixed the autocast dtype bug - #6919

Merged
albertvillanova merged 1 commit into
mainfrom
revert-hotfix-moe-lora-parametrization-dtype
Aug 25, 2026
Merged

Revert xfail for MoE LoRA tests now that peft#3602 fixed the autocast dtype bug#6919
albertvillanova merged 1 commit into
mainfrom
revert-hotfix-moe-lora-parametrization-dtype

Conversation

@albertvillanova

@albertvillanova albertvillanova commented Aug 25, 2026

Copy link
Copy Markdown
Member

This PR reverts the temporary xfail markers added for the MoE LoRA tests, now that the underlying bug has been fixed upstream:

Fix #6914.

Motivation

peft's LoRA parametrization for MoE expert parameters returned bf16 under autocast, which register_parametrization rejects, so the MoE LoRA tests were marked xfail as a temporary hotfix (#6915) to keep CI green. The bug has since been fixed upstream in peft#3602.

Solution

Revert the hotfix commit that added the xfail markers, restoring the tests to their normal (non-xfail) state.

Changes

  • Remove the xfail markers from the MoE LoRA tests in test_dpo_trainer.py, test_grpo_trainer.py, test_kto_trainer.py, test_reward_trainer.py, test_rloo_trainer.py and test_sft_trainer.py
  • Remove the now-unused Version and peft imports from test_reward_trainer.py

Note

Low Risk
Test-only change with no production code paths; CI may fail if the environment still uses a peft version without the upstream fix.

Overview
Reverts the temporary xfail markers on MoE + PEFT/LoRA training tests now that peft#3602 fixes the autocast dtype issue that broke register_parametrization (closes #6914).

Affected suites: DPO, GRPO, KTO, Reward, RLOO, and SFT (test_train_moe_with_peft_config / test_train_moe_peft_model where applicable). Those tests run as normal failures/pass again instead of expected failures on peft dev releases.

In test_reward_trainer.py, drops unused packaging.version.Version and top-level peft imports that only served the xfail condition.

Reviewed by Cursor Bugbot for commit dec5654. Bugbot is set up for automated code reviews on this repo. Configure here.

@bot-ci-comment

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@albertvillanova

albertvillanova commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

Merging this PR as a hotfix: https://github.com/huggingface/trl/actions/runs/32867925767/job/97867656964

FAILED tests/test_dpo_trainer.py::TestDPOTrainer::test_train_moe_with_peft_config - [XPASS(strict)] peft's LoRA parametrization for MoE expert parameters returns bf16 under autocast, which register_parametrization rejects (see #6914).
...

@albertvillanova
albertvillanova merged commit 4391de6 into main Aug 25, 2026
10 checks passed
@albertvillanova
albertvillanova deleted the revert-hotfix-moe-lora-parametrization-dtype branch August 25, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI fails with dev dependencies for MoE LoRA target_parameters: ValueError: Registering a parametrization may not change the dtype of the tensor

1 participant