Skip to content

Sort conditional imports#6180

Merged
qgallouedec merged 7 commits into
mainfrom
sort-imports
Jun 29, 2026
Merged

Sort conditional imports#6180
qgallouedec merged 7 commits into
mainfrom
sort-imports

Conversation

@qgallouedec

@qgallouedec qgallouedec commented Jun 25, 2026

Copy link
Copy Markdown
Member

Minor consistency import sorting


Note

Low Risk
Import reordering and formatting only; no training or runtime logic changes.

Overview
Reorders optional dependency imports (if is_*_available(): …) and tightens multi-line from … import lists to a single line in trainers, extras/profiling, models/activation_offloading, and related tests. The intent is a shared layout: optional blocks grouped with blank lines between them, and module-level logger / constants placed after those blocks where they were previously interleaved.

Test-only tweaks: drops a no-op is_peft_available() stub in test_gspo_token_trainer.py, and imports PEFTAdapterEMACallback unconditionally in test_self_distillation_trainer_behavior.py instead of nesting it inside the PEFT guard.

Reviewed by Cursor Bugbot for commit 4503c21. 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 86faa59ccd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread trl/trainer/grpo_trainer.py
@qgallouedec qgallouedec requested review from AmineDiro and kashif June 25, 2026 22:31

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d1b9a5a. Configure here.

Comment thread trl/trainer/grpo_trainer.py

@albertvillanova albertvillanova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

The CI is red. Do you know why the CI has been failing today apparently in a non-deterministic way?

@qgallouedec

Copy link
Copy Markdown
Member Author

No idea!

@qgallouedec

Copy link
Copy Markdown
Member Author

It seems like transient hub errors

@qgallouedec qgallouedec merged commit eefd18d into main Jun 29, 2026
12 of 15 checks passed
@qgallouedec qgallouedec deleted the sort-imports branch June 29, 2026 17:02
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.

2 participants