Skip to content
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

Add support for HIP explicit multipass #790

Merged
merged 2 commits into from
Aug 1, 2022

Conversation

illuhad
Copy link
Collaborator

@illuhad illuhad commented Jul 30, 2022

This PR adds support for the hip.explicit-multipass compilation flow in the HIP backend. In hipSYCL explicit multipass flows, hipSYCL takes control over multipass compilation, kernel embedding, kernel caching and low-level module management. It also uses low-level kernel launch mechanisms instead of relying on clang-generated kernel launch stubs.

The motivation for this PR is the discussion regarding latency of hipLaunchKernel itself in PR #761 (CC @sbalint98). On the CUDA side, explicit multipass is known to substantially outperform the CUDA runtime API as far as kernel launch latencies are concerned - presumably because our kernel cache is better than whatever the CUDA runtime does. Because of this, I wanted to see if a similar speedup could be achieved on the HIP side.

With a quick test on my APU, so far unfortunately I do not see evidence for a difference in kernel launch latency between the new HIP explicit multipass and the old integrated multipass flows. But to draw proper conclusions, we will have to try again with a proper discrete GPU and look at profiler timelines which I have not done yet.
It might also be the case that on HIP there is no such difference, because the HIP API ingests compiled binaries, not an IR like PTX on the CUDA side, and therefore the kernel cache performance is potentially less important.

HIP explicit multipass is only supported on clang 13+.
TODO: We actually need to enforce that limitation; currently things just will not work with earlier clangs without clear error message.

@illuhad illuhad force-pushed the feature/hip-explicit-multipass branch from f59b156 to 0bb219a Compare July 30, 2022 02:20
@illuhad illuhad marked this pull request as ready for review July 31, 2022 22:32
@illuhad illuhad merged commit 3067486 into develop Aug 1, 2022
@illuhad illuhad deleted the feature/hip-explicit-multipass branch August 1, 2022 13:31
DieGoldeneEnte pushed a commit to DieGoldeneEnte/hipSYCL that referenced this pull request Aug 8, 2022
* Add support for HIP explicit multipass

* Raise error when hip.explicit-multipass is used with clang < 13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant