You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BugFix][Profiler] Use the current CUDA device when no device is specified - #3357
When the current CUDA device is nonzero and do_bench receives no explicit device, _cache_device(None) uses the module's cuda:0 default. The cache-flush allocation can therefore target a different GPU from the benchmarked work.
Use the unindexed "cuda" default so PyTorch resolves the active device when the buffer is allocated. Explicit device selection and the NPU/MPS defaults are preserved. The current diff is one line; the earlier standalone host tests were removed during maintainer revision.
Validation:
Upstream CI run 37915443170 completed successfully for head 971c4c4: Quick Lint, CUDA, ROCm, Metal, Ascend, and CuTeDSL examples.
The later pull-request runs require maintainer approval and have not executed tests.
No local CUDA hardware or timing benchmarks were run.
do_bench now uses "cuda" as its default device string when CUDA is available. This allows the current CUDA device to be resolved at each call. The NPU and MPS defaults remain unchanged.
No test results or formatting checks are established by the supplied repository evidence. The change does not touch C++, CI, lint tooling, or C++ style documentation.
👋 Hi! Thank you for contributing to the TileLang project.
Please remember to run pre-commit run --all-files in the root directory of the project to ensure your changes are properly linted and formatted. This will help ensure your contribution passes the format check.
We appreciate you taking this step! Our team will review your contribution, and we look forward to your awesome work! 🚀
Reviewing files that changed from the base of the PR and between 75660b9 and 971c4c4.
📒 Files selected for processing (1)
tilelang/profiler/bench.py
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
📝 Walkthrough
The benchmark code now uses "cuda" instead of "cuda:0" as its default device string when CUDA is available. The NPU and MPS defaults are unchanged.
When the device is omitted, benchmark resources now follow the active CUDA device; explicit selection and non-CUDA defaults are preserved. No material merge risk is established.
Pre-merge checks: 5
Check name
Status
Explanation
Docstring Coverage
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely describes the main change: using the current CUDA device when no device is specified in the profiler.
✨ Finishing Touches
🧪 Generate unit tests (beta)
Create a new PR
Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Autopilot is currently an internal CodeRabbit preview.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Added docstrings for the touched helper and test methods in 7c99e7e. All five host regression tests and the targeted formatting checks pass.
Afloat16
changed the title
[BugFix][Profiler] Flush the current CUDA device when no device is specified
[BugFix][Profiler] Use the current CUDA device when no device is specified
Oct 1, 2026
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
bugSomething isn't workingpythonPull requests that update python code
3 participants
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.
When the current CUDA device is nonzero and
do_benchreceives no explicit device,_cache_device(None)uses the module'scuda:0default. The cache-flush allocation can therefore target a different GPU from the benchmarked work.Use the unindexed
"cuda"default so PyTorch resolves the active device when the buffer is allocated. Explicit device selection and the NPU/MPS defaults are preserved. The current diff is one line; the earlier standalone host tests were removed during maintainer revision.Validation:
971c4c4: Quick Lint, CUDA, ROCm, Metal, Ascend, and CuTeDSL examples.No local CUDA hardware or timing benchmarks were run.
do_benchnow uses"cuda"as its default device string when CUDA is available. This allows the current CUDA device to be resolved at each call. The NPU and MPS defaults remain unchanged.No test results or formatting checks are established by the supplied repository evidence. The change does not touch C++, CI, lint tooling, or C++ style documentation.