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
successive custom operations on the same SYCL queue sometimes execute in different HIP streams #614
Comments
This is expected behavior. The hipSYCL scheduler automatically distributes work across multiple backend streams in order to offer to the hardware to execute independent operations in parallel. There is no direct mapping between a If you think you know better than the hipSYCL scheduler, you can attach the EDIT: It might even work to pass this property to the |
Thanks, I will consider further! |
Replacing the submissions for kernels with
I see that the hipStream can differ even when the property is passed. If that's expected behavior, then GROMACS will need to set the stream before every call to |
From a quick glance over the submission code, I don't see any issue. |
I was also hiding them with extra declarations of stream1 and stream2 in the custom operations and then discarding their values. If I try to save the values in a mutable lambda, things crash, but I'm not sure why yet. |
Exactly :) So either manually check by writing to the console or use a buffer to store the streams and compare later... |
Ahh, that's great to know, thanks. I was using mutable lambdas only when probing for why things were wrong... creating more problems |
mutable kernel lambdas (i.e. things that are passed to One pattern to return values from asynchronous SYCL operations that should work well is to wrap the value in a |
This is not expected behavior. The interpretation of the property is in general backend-specific, but with all current hipSYCL backends it should guarantee that all submitted operations are scheduled to the same backend queue/stream. |
Bug summary
hipSYCL's custom operations sometimes execute in a different native stream even when on the same SYCL queue
To Reproduce
Add the fragment below to e.g. tests/sycl/accessor.cpp, build targeting an AMD device, and repeat running
./sycl_tests --run_test=accessor_tests/custom_kernel
until the assertion onstream1 != stream2
fails. Around 1 execution in 4 fails for me. See sample failing output below.Expected behavior
I expected that all operations on a SYCL queue take place on the same underlying
hipStream_t
and that that stream is also the one used for a hipSYCL custom operation. If this is not the case, then arranging for correct dependencies may be difficult.Describe your setup
hipSYCL built from today's develop commit 3e05c38, built on ROCm 4.2, using the clang compiler installed with ROCm, and targeting
hip:gfx906
. The node has two such devices.Optional additional diagnostic information
Sample failing output is found below. Note HIPSYCL_DEBUG_LEVEL=3 is on
Additional context
GROMACS would like to set the hipStream_t for the subsequent rocFFT calls once during setup and then repeatedly call
rocfft_execute
and rely on getting the same stream each time.The text was updated successfully, but these errors were encountered: