Repository navigation
Restore facts the comment trim cut from the unsloth package - #10328
Merged
Merged
Conversation
The trim in #10116 shortened comments past the point where they still carried the fact that justified the code. Sixteen sites, comments only: - _gpu_init.py: why the torchaudio guard sits above `import unsloth_zoo` rather than in the late import-fix block, and the failure that motivated it. - import_fixes.py: why the default stubs are inert at all, namely that on transformers <5 the whole module is ours and peft's converter never runs. - kernels/utils.py: that plain attribute access does not survive a partial bitsandbytes import, which is why the retry uses `import x.y as z`. - save.py: that the cache copy lands wherever the cache is, which need not be the filesystem holding save_directory (HF_HOME on a data volume is the ordinary multi-disk layout); that each drop message names the filesystem it measured; and that HfApi is the module-level import. - tokenizer_utils.py: an `# else:` note had been folded into the preceding `elif`, where it read as if the branch that sets cache_dir = None also honours a caller-supplied cache_dir. Moved back and its reason restored. - models/rl.py: the TRL eval_packing line and why packing beats truncating, the max_length/packing condition, the raw-split carve-out that makes the early `return True` safe, and two commented-out dict entries that had been fused into one prose sentence. - models/_utils.py, models/loader_utils.py: the named re-entrant callers and the conclusion that makes the bare `return kwargs` safe. Five other flagged sites were false positives and are untouched. The gate reports code unchanged on all eight files.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The comment trim in #10116 shortened a number of comments in the
unslothpackage past the point where they still carried the fact that justified the code underneath. This puts those facts back. Comments only: the gate reports code unchanged on all eight files, and a diff of non-comment lines is empty.Sixteen sites, the ones worth calling out:
_gpu_init.py- the guard sits aboveimport unsloth_zoorather than in the late import-fix block further down, and the trimmed text no longer said why. Restored the placement rationale and the failure that motivated it.import_fixes.py- restored why the default stubs are inert at all: on transformers <5 the whole module is ours and peft's converter never runs. Without it the surviving sentence about a real transformers is a non-sequitur.kernels/utils.py- restored that plain attribute access does not survive a partial bitsandbytes import, which is the entire reason the retry is writtenimport bitsandbytes.functional as bnb_functional.save.py- the cache copy lands wherever the cache is, which need not be the filesystem holdingsave_directory;HF_HOMEon a data volume is the ordinary layout on a machine with more than one disk. The trimmed text had compressed this into "lands wherever HF_HOME points", which is not the same claim. Also restored that each drop message names the filesystem it measured, and thatHfApiis the module-level import whilehf_hub_downloadis local.tokenizer_utils.py- the trim folded an# else:note into the precedingelif, where it read as if the branch that setscache_dir = Nonealso honours a caller-suppliedcache_dir. Moved back below the branch with its reason.models/rl.py- the largest group. Restored the literal TRLeval_packingline and why packing beats truncating (wrappedconcatenates before chunking,bfd_splitsplits an overlength example into more chunks; cutting rows at the cap first throws that away), themax_length/packing condition, and the raw-split carve-out that makes the earlyreturn Truesafe. Two commented-out dict entries had been fused into a single prose sentence; both are back on their own lines.models/_utils.py,models/loader_utils.py- the named re-entrant callers, and the conclusion that makes the barereturn kwargssafe.Five further sites flagged by the same scan were false positives, complete sentences that lost nothing, and are untouched.
Every restored claim was checked against the current code rather than copied back from the old text. One stale figure in the original ("roughly 95 lines") was deliberately not restored, since the file has drifted past it.