Skip to content

Minor changes trainer#43744

Merged
SunMarc merged 26 commits intomainfrom
minor-changes-trainer
Feb 10, 2026
Merged

Minor changes trainer#43744
SunMarc merged 26 commits intomainfrom
minor-changes-trainer

Conversation

@SunMarc
Copy link
Copy Markdown
Member

@SunMarc SunMarc commented Feb 4, 2026

What does this PR do?

This PR updates a few minor things from trainer. Some of them are breaking but I think it should be safe to do as I don't think anyone is subclassing them or using them separately.

Breaking:

  • move propagate_args_to_deepspeed to standalone function in integrations.deepspeed
  • move _fsdp_qlora_plugin_updates to standalone function in integrations.fsdp + rename to update_fsdp_plugin_peft
  • move is_attention_mask_causal to standalone function in trainer_pt_utils.py
  • move _nested_gather to standalone function in trainer_pt_utils.py
  • remove _add_sm_patterns_to_gitignore -> not used at all
  • move _align_special_tokens to standalone function in trainer_pt_utils.py
  • move deepspeed_sp_compute_loss to integrations.deepspeed
  • move deepspeed_sp_compute_loss to integrations.deepspeed
  • move _save_tpu to save_tpu_checkpoint in integrations.tpu file
  • added wrap_model_xla_fsdp to move logic in integrations.fsdp` file

Not breaking:

  • move get_fsdp_ckpt_kwargs to integrations.fsdp
  • move safe_globals to trainer_utils.py
  • move _get_learning_rate in Trainer as this method is actually used and not only in examples.

@HuggingFaceDocBuilderDev
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.

@qgallouedec
Copy link
Copy Markdown
Member

Thanks, I'll review asap

@SunMarc
Copy link
Copy Markdown
Member Author

SunMarc commented Feb 5, 2026

cc @winglian

Comment thread src/transformers/trainer_pt_utils.py
@SunMarc SunMarc requested a review from winglian February 5, 2026 16:35
@SunMarc
Copy link
Copy Markdown
Member Author

SunMarc commented Feb 5, 2026

@bot /style

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 5, 2026

Style fix bot fixed some files and pushed the changes.

Comment thread src/transformers/trainer.py
Comment thread src/transformers/trainer.py Outdated
Copy link
Copy Markdown
Member

@qgallouedec qgallouedec left a comment

Choose a reason for hiding this comment

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

this looks good!

Comment thread src/transformers/trainer_utils.py Outdated
@SunMarc SunMarc requested a review from kashif February 6, 2026 15:42
Copy link
Copy Markdown
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

I am down to keep aliases for now + deprecate (but its up to you if you can adds lots of coms about it)

Trying to refrain from too many breaks from v5 already

@SunMarc
Copy link
Copy Markdown
Member Author

SunMarc commented Feb 9, 2026

Can you run the TRL CI on this PR @qgallouedec ? Also @winglian, is there a way to run the axolotl CI just like we do for TRL ? One of my next step also would be to create nice tests like TRL so that we don't need to rely on TRL to catch regressions.

I am down to keep aliases for now + deprecate (but its up to you if you can adds lots of coms about it)

I think for these, it shouldn't be too breaking. There are other more sensible arg that will indeed require to deprecate if we want to ensure a smooth transition in a future PR. If any of those are too breaking, happy to put it back and do a proper deprecation cycle.

@qgallouedec
Copy link
Copy Markdown
Member

/trl-ci

@qgallouedec
Copy link
Copy Markdown
Member

https://github.com/huggingface/trl/actions/runs/21873008073

@SunMarc SunMarc merged commit 24c743e into main Feb 10, 2026
26 checks passed
@SunMarc SunMarc deleted the minor-changes-trainer branch February 10, 2026 20:03
jiosephlee pushed a commit to jiosephlee/transformers_latest that referenced this pull request Feb 11, 2026
@tomaarsen
Copy link
Copy Markdown
Member

This resulted in a regression in Sentence Transformers due to the removal of _nested_gather. I'll try to push out a release soon to resolve it. See huggingface/sentence-transformers#3664 for more details.

  • Tom Aarsen

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.

8 participants