Gate trl disable_gradient_checkpointing patch warning on UNSLOTH_ENABLE_LOGGING (#5038)
The "Patched trl.models.utils.disable_gradient_checkpointing with a no-op" warning fires once on every Unsloth import, including from notebooks where the user did not opt into verbose logging. It is a routine integration patch, not an anomaly the user needs to know about. Gate it on UNSLOTH_ENABLE_LOGGING=1 like other diagnostic notices.
This commit is contained in:
parent
777e1bd0ac
commit
156f3fc4b0
1 changed files with 6 additions and 5 deletions
|
|
@ -2018,11 +2018,12 @@ def patch_trl_disable_gradient_checkpointing():
|
|||
except (AttributeError, TypeError):
|
||||
pass
|
||||
|
||||
logger.warning_once(
|
||||
"Unsloth: Patched trl.models.utils.disable_gradient_checkpointing with "
|
||||
"a no-op to preserve Unsloth gradient checkpointing across TRL "
|
||||
"generation passes."
|
||||
)
|
||||
if os.environ.get("UNSLOTH_ENABLE_LOGGING", "0") == "1":
|
||||
logger.warning_once(
|
||||
"Unsloth: Patched trl.models.utils.disable_gradient_checkpointing with "
|
||||
"a no-op to preserve Unsloth gradient checkpointing across TRL "
|
||||
"generation passes."
|
||||
)
|
||||
return
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue