-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Add query and synchronize to c10::Stream #59560
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
Conversation
`at::cuda::CUDAStream` has the `query` and `synchronize` methods, but `c10::Stream` does not, and I couldn't find any generic way to accomplish this. Hence I added helpers to do this to the DeviceGuardImpl interface, and then defined these methods on `c10::Stream`. (I had to do it out-of-line to circumvent a circular dependency). Differential Revision: [D28931377](https://our.internmc.facebook.com/intern/diff/D28931377/) [ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit a033ec2 (more details on the Dr. CI page):
🕵️ 2 new failures recognized by patternsThe following CI failures do not appear to be due to upstream breakages:
|
| Job | Step | Action |
|---|---|---|
| Doc test | 🔁 rerun |
This comment was automatically generated by Dr. CI (expand for details).
Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions to the (internal) Dr. CI Users group.
`at::cuda::CUDAStream` has the `query` and `synchronize` methods, but `c10::Stream` does not, and I couldn't find any generic way to accomplish this. Hence I added helpers to do this to the DeviceGuardImpl interface, and then defined these methods on `c10::Stream`. (I had to do it out-of-line to circumvent a circular dependency). Differential Revision: [D28931377](https://our.internmc.facebook.com/intern/diff/D28931377/) [ghstack-poisoned]
`at::cuda::CUDAStream` has the `query` and `synchronize` methods, but `c10::Stream` does not, and I couldn't find any generic way to accomplish this. Hence I added helpers to do this to the DeviceGuardImpl interface, and then defined these methods on `c10::Stream`. (I had to do it out-of-line to circumvent a circular dependency). Differential Revision: [D28931377](https://our.internmc.facebook.com/intern/diff/D28931377/) [ghstack-poisoned]
`at::cuda::CUDAStream` has the `query` and `synchronize` methods, but `c10::Stream` does not, and I couldn't find any generic way to accomplish this. Hence I added helpers to do this to the DeviceGuardImpl interface, and then defined these methods on `c10::Stream`. (I had to do it out-of-line to circumvent a circular dependency). Differential Revision: [D28931377](https://our.internmc.facebook.com/intern/diff/D28931377/) [ghstack-poisoned]
`at::cuda::CUDAStream` has the `query` and `synchronize` methods, but `c10::Stream` does not, and I couldn't find any generic way to accomplish this. Hence I added helpers to do this to the DeviceGuardImpl interface, and then defined these methods on `c10::Stream`. (I had to do it out-of-line to circumvent a circular dependency). Differential Revision: [D28931377](https://our.internmc.facebook.com/intern/diff/D28931377/) [ghstack-poisoned]
`at::cuda::CUDAStream` has the `query` and `synchronize` methods, but `c10::Stream` does not, and I couldn't find any generic way to accomplish this. Hence I added helpers to do this to the DeviceGuardImpl interface, and then defined these methods on `c10::Stream`. (I had to do it out-of-line to circumvent a circular dependency). Differential Revision: [D28931377](https://our.internmc.facebook.com/intern/diff/D28931377/) [ghstack-poisoned]
`at::cuda::CUDAStream` has the `query` and `synchronize` methods, but `c10::Stream` does not, and I couldn't find any generic way to accomplish this. Hence I added helpers to do this to the DeviceGuardImpl interface, and then defined these methods on `c10::Stream`. (I had to do it out-of-line to circumvent a circular dependency). Differential Revision: [D28931377](https://our.internmc.facebook.com/intern/diff/D28931377/) [ghstack-poisoned]
`at::cuda::CUDAStream` has the `query` and `synchronize` methods, but `c10::Stream` does not, and I couldn't find any generic way to accomplish this. Hence I added helpers to do this to the DeviceGuardImpl interface, and then defined these methods on `c10::Stream`. (I had to do it out-of-line to circumvent a circular dependency). Differential Revision: [D28931377](https://our.internmc.facebook.com/intern/diff/D28931377/) [ghstack-poisoned]
`at::cuda::CUDAStream` has the `query` and `synchronize` methods, but `c10::Stream` does not, and I couldn't find any generic way to accomplish this. Hence I added helpers to do this to the DeviceGuardImpl interface, and then defined these methods on `c10::Stream`. (I had to do it out-of-line to circumvent a circular dependency). Differential Revision: [D28931377](https://our.internmc.facebook.com/intern/diff/D28931377/) [ghstack-poisoned]
`at::cuda::CUDAStream` has the `query` and `synchronize` methods, but `c10::Stream` does not, and I couldn't find any generic way to accomplish this. Hence I added helpers to do this to the DeviceGuardImpl interface, and then defined these methods on `c10::Stream`. (I had to do it out-of-line to circumvent a circular dependency). Differential Revision: [D28931377](https://our.internmc.facebook.com/intern/diff/D28931377/) [ghstack-poisoned]
c10/cuda/CUDAStream.h
Outdated
| } | ||
|
|
||
| return false; | ||
| return stream_.query(); |
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.
This is backwards: the true implementation should live here, and the DeviceGuard impl should construct a CUDAStream and call into this implementation. This way, users of CUDAStream bypass dynamic dispatch on the virtual method.
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, and it leaves CUDAStream untouched, which is reassuring. It also fixes a weird HIP issue later in the stack, so that's neat too.
|
Seems reasonable enough to me. |
`at::cuda::CUDAStream` has the `query` and `synchronize` methods, but `c10::Stream` does not, and I couldn't find any generic way to accomplish this. Hence I added helpers to do this to the DeviceGuardImpl interface, and then defined these methods on `c10::Stream`. (I had to do it out-of-line to circumvent a circular dependency). Differential Revision: [D28931377](https://our.internmc.facebook.com/intern/diff/D28931377/) [ghstack-poisoned]
`at::cuda::CUDAStream` has the `query` and `synchronize` methods, but `c10::Stream` does not, and I couldn't find any generic way to accomplish this. Hence I added helpers to do this to the DeviceGuardImpl interface, and then defined these methods on `c10::Stream`. (I had to do it out-of-line to circumvent a circular dependency). Differential Revision: [D28931377](https://our.internmc.facebook.com/intern/diff/D28931377/) [ghstack-poisoned]
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.
okey dokey
|
This pull request has been merged in e7cccc2. |
Stack from ghstack:
at::cuda::CUDAStreamhas thequeryandsynchronizemethods, butc10::Streamdoes not, and I couldn't find any generic way to accomplish this. Hence I added helpers to do this to the DeviceGuardImpl interface, and then defined these methods onc10::Stream. (I had to do it out-of-line to circumvent a circular dependency).Differential Revision: D28931377