Skip to content

Studio: honor the 'none' gradient checkpointing option in training - #7128

Merged
oobabooga merged 1 commit into
unslothai:mainfrom
oobabooga:fix-gradient-checkpointing-none
Jul 15, 2026
Merged

oobabooga merged 1 commit into
unslothai:mainfrom
oobabooga:fix-gradient-checkpointing-none

Conversation

@oobabooga

Copy link
Copy Markdown
Member

Selecting None in the training "Gradient checkpointing" dropdown did nothing on the main LoRA/QLoRA path. Studio silently kept Unsloth's checkpointing on and logged a bogus "Invalid value" warning, so a user who wanted it off couldn't turn it off.

Fix

The trainer only recognized true/false-style values and dropped none to its default. Add none (and off) to the disable case, so the dropdown choice is honored. The MLX and embedding training paths already did this, so this just brings the LoRA path in line.

No other option changes: Unsloth, Standard, and the default behave exactly as before.

Verification

Confirmed the none value reaches the trainer unchanged from the dropdown, that it now disables checkpointing (instead of being reset to Unsloth), and that the sibling paths already behaved this way. No existing test relied on the old behavior.

Surfaced by an AMD (gfx1201) user who reported Unsloth "forcing smart memory despite selecting none": https://www.reddit.com/r/unsloth/comments/1uunobi/any_roadmap_for_when_gfx1201_will_become/. Their training also crashes, which is a separate issue.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates the prepare_model_for_training function in trainer.py to recognize 'none' and 'off' as valid string representations for disabling gradient checkpointing. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@oobabooga

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: b64acc229f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@oobabooga
oobabooga merged commit 5531347 into unslothai:main Jul 15, 2026
34 checks passed
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.

1 participant