Microbenchmark - Fix precision loss in kernel launch overhead benchmark#773
Microbenchmark - Fix precision loss in kernel launch overhead benchmark#773alephpiece wants to merge 5 commits intomicrosoft:mainfrom
Conversation
|
Thanks @alephpiece for pointing out this issue. We will verify and review this PR. |
There was a problem hiding this comment.
Pull request overview
This PR fixes a precision loss bug in the kernel launch overhead microbenchmark where integer division was causing microsecond components to be truncated to zero for sub-millisecond measurements.
Changes:
- Refactored time calculation from expanding then subtracting to subtracting then expanding, using floating-point arithmetic throughout
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #773 +/- ##
=======================================
Coverage 85.69% 85.69%
=======================================
Files 103 103
Lines 7890 7890
=======================================
Hits 6761 6761
Misses 1129 1129
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@alephpiece could you please run |
|
@guoshzhao |
Description
The original code uses integer division in the time calculation: (end_tv.tv_usec) / 1000. Since an empty kernel launch overhead is typically very small (often less than 1ms), this integer division truncates the microsecond component to 0, leading to significant precision loss and incorrect results.
Major Revision