Repository navigation
CPU backend: sync the compile cache tag only on the GPU backend (unsloth.kernels loaded on CPU since #18111) - #18117
Merged
Conversation
…sync (GPU backend only)
Member
Author
|
@codex review |
Codex Review Summary: ✅ CompletedThis 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. |
|
Codex Review: Didn't find any major issues. 🎉 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.
Two CPU-backend tests fail on main in the CPU
restshard since #18111 (seen on the staging runs of #18075 and #18076):Cause
#18111 added, at the end of
unsloth/__init__.py:It runs for every backend. On a machine with no accelerator,
import unslothnow loadsunsloth.kernels(and everything its package__init__pulls in, 87 modules) even though the CPU backend deliberately never loads GPU kernels; the tests above guard exactly that.The sync itself is right, but it only matters where kernels add tags to
torch.compiler.config.cache_key_tag, i.e. the GPU backend, which has already importedunsloth.kernelsby then. On the CPU backend there is no tag to hand to compile workers.Fix
Run the sync only when the GPU backend was selected (
_IS_CPU_BACKENDis False). The MLX branch never defines_IS_CPU_BACKEND, so it is skipped there too.Verification
tests/test_cpu_backend_init.py,tests/test_cpu_backend_tiled_mlp.py: 2 failed on main, pass here.tests/test_compile_cache_tag_workers.py(Warm restarts: hand the compile cache key tag to Inductor's compile workers (no autotune re-benchmark every run) #18111's own tests): 6 passed.