-
Notifications
You must be signed in to change notification settings - Fork 82
SWDEV-569450 - Fix Unit_hipStreamBeginCaptureToGraph_CapturePartialInThreads #2072
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes the Unit_hipStreamBeginCaptureToGraph_CapturePartialInThreads test by ensuring that when an event is recorded on a new stream during graph capture, it is properly removed from the previous stream's capture event list.
Key Changes:
- Added logic to erase the event from the previous capture stream before setting a new capture stream
- Prevents duplicate event tracking across multiple streams during graph capture operations
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
b826a04 to
fe3c8e6
Compare
6f35d03 to
73ac21e
Compare
| if (hipStream_t lastCaptureStream = e->GetCaptureStream()) { | ||
| if (hip::isValid(lastCaptureStream)) { | ||
| if ((lastCaptureStream != nullptr) && (lastCaptureStream != hipStreamLegacy)) { | ||
| reinterpret_cast<hip::Stream*>(e->GetCaptureStream())->EraseCaptureEvent(event); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It Should get cleared during end capture.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense if same event is used again to record during capture.
73ac21e to
d392d8f
Compare
Motivation
This PR fixes the Unit_hipStreamBeginCaptureToGraph_CapturePartialInThreads test by ensuring that when an event is recorded on a new stream during graph capture, it is properly removed from the previous stream's capture event list.
Otherwise when the event is destroyed, it can lead to a dangled event reference in the original stream and cause a segfault.
Technical Details
Added logic to erase the event from the previous capture stream before setting a new capture stream
Prevents duplicate event tracking across multiple streams during graph capture operations.
Test Plan
Unit_hipStreamBeginCaptureToGraph_CapturePartialInThreads should pass
Test Result
Unit_hipStreamBeginCaptureToGraph_CapturePartialInThreads passes and does not show any warning in valgrind
Submission Checklist