[BugFix][Autotune] Drain timed-out benchmark calls - #2840
Conversation
|
👋 Hi! Thank you for contributing to the TileLang project. Please remember to run We appreciate you taking this step! Our team will review your contribution, and we look forward to your awesome work! 🚀 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe benchmark worker now drains a timed-out benchmark thread before starting another configuration. A threaded regression test verifies timeout ordering, delayed execution, and clean worker shutdown. ChangesAutotuner timeout handling
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b95a44c6a
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d47bee3ad
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e56c9f2fe6
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| del benchmark_state, benchmark_device | ||
| if jit_kernel == "slow": | ||
| slow_call_started.set() | ||
| release_slow_call.wait(timeout=1) |
There was a problem hiding this comment.
Wait indefinitely for the explicit release event
When a loaded CI worker does not reschedule the test thread for more than one second after slow_call_started.set(), this timed wait releases the slow call automatically, allowing the worker to publish its result and start the fast call before the assertions on lines 49–50. The fresh event-based revision therefore still has the original scheduling race; wait without a timeout here, since the finally block already guarantees that the event is released.
Useful? React with 👍 / 👎.
Fixes #2838.
Problem
A worker reported a benchmark timeout then immediately accepted another configuration while the timed-out daemon thread continued to run. That allowed CUDA work and measurement state to overlap on the same worker.
Change
After reporting a timeout, the worker drains the still-running benchmark thread before reading its next task.
This does not claim to force-cancel arbitrary Python/CUDA code; an uncooperative call can still block that worker. Other workers remain independent.
Regression coverage
The new test queues a slow call and a fast call, verifies the timeout arrives promptly, and verifies the fast call cannot start before the slow one completes.
Validation
Summary
Validation
git diff --checkpassed.