Repository navigation
[hip] Handle when devices cannot access peers, such as on Windows. - #20114
Merged
Merged
Conversation
ScottTodd
requested review from
antiagainst and
nithinsubbiah
as code owners
February 26, 2025 23:53
benvanik
approved these changes
Feb 27, 2025
geomin12
pushed a commit
to geomin12/iree
that referenced
this pull request
Mar 5, 2025
…ree-org#20114) With this change, I am able to now follow our ROCm instructions at https://iree.dev/guides/deployment-configurations/gpu-rocm/ on Windows, running MobileNet and getting the expected outputs 🎉 This does two things: 1. Only try to enable peering between devices if more than 1 device is going to be used 2. Check `hipDeviceCanAccessPeer` before calling `hipDeviceEnablePeerAccess` so there is a chance to log a better error message ### More information On Windows 11 with 2x w7900 and the 6.2 HIP SDK, the previous code returned `hipErrorInvalidDevice` when calling `hipDeviceEnablePeerAccess`. On the same system under Linux (unknown HIP/ROCm version but pretty similar), the code works without errors. In both cases, I only requested a single device, so this peering code did not need to run at all. See also [this discussion on Discord](https://discord.com/channels/689900678990135345/1282818085153407038/1344105197353570377). See documentation for these APIs at https://rocm.docs.amd.com/projects/HIP/en/latest/doxygen/html/group___peer_to_peer.html. ### Testing > [!WARNING] > I've only tested on the machines I have easy access to. I think we still need CI coverage for multi-device (e.g. iree-org#19995) Signed-off-by: geomin12 <[email protected]>
5 of 6 tasks
AWoloszyn
added a commit
to AWoloszyn/iree
that referenced
this pull request
Apr 7, 2025
iree-org#20114 disabled all peering any time we only have a single physical device backing a logical device. This broke our current sharded models: iree-org#20409 Our current sharded models are not set up this way, they have multiple logical devices backed by multiple physical devices, so every hip_device has only a single physical device, and peering is never enabled at all (see iree-org#19555) for the original change to allow this. This change enables peering for all devices with all devices that are compatible, which should fix our sharded models. Howewver we should at some point update our sharding method to correctly use single logical devices backed by multiple physical devices. Signed-off-by: Andrew Woloszyn <[email protected]>
AWoloszyn
added a commit
that referenced
this pull request
Apr 7, 2025
#20114 disabled all peering any time we only have a single physical device backing a logical device. This broke our current sharded models: #20409 Our current sharded models are not set up this way, they have multiple logical devices backed by multiple physical devices, so every hip_device has only a single physical device, and peering is never enabled at all (see #19555) for the original change to allow this. This change enables peering for all devices with all devices that are compatible, which should fix our sharded models. Howewver we should at some point update our sharding method to correctly use single logical devices backed by multiple physical devices. Signed-off-by: Andrew Woloszyn <[email protected]>
AWoloszyn
pushed a commit
that referenced
this pull request
Dec 1, 2025
…20114) With this change, I am able to now follow our ROCm instructions at https://iree.dev/guides/deployment-configurations/gpu-rocm/ on Windows, running MobileNet and getting the expected outputs 🎉 This does two things: 1. Only try to enable peering between devices if more than 1 device is going to be used 2. Check `hipDeviceCanAccessPeer` before calling `hipDeviceEnablePeerAccess` so there is a chance to log a better error message ### More information On Windows 11 with 2x w7900 and the 6.2 HIP SDK, the previous code returned `hipErrorInvalidDevice` when calling `hipDeviceEnablePeerAccess`. On the same system under Linux (unknown HIP/ROCm version but pretty similar), the code works without errors. In both cases, I only requested a single device, so this peering code did not need to run at all. See also [this discussion on Discord](https://discord.com/channels/689900678990135345/1282818085153407038/1344105197353570377). See documentation for these APIs at https://rocm.docs.amd.com/projects/HIP/en/latest/doxygen/html/group___peer_to_peer.html. ### Testing > [!WARNING] > I've only tested on the machines I have easy access to. I think we still need CI coverage for multi-device (e.g. #19995)
AWoloszyn
added a commit
that referenced
this pull request
Dec 1, 2025
#20114 disabled all peering any time we only have a single physical device backing a logical device. This broke our current sharded models: #20409 Our current sharded models are not set up this way, they have multiple logical devices backed by multiple physical devices, so every hip_device has only a single physical device, and peering is never enabled at all (see #19555) for the original change to allow this. This change enables peering for all devices with all devices that are compatible, which should fix our sharded models. Howewver we should at some point update our sharding method to correctly use single logical devices backed by multiple physical devices. Signed-off-by: Andrew Woloszyn <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With this change, I am able to now follow our ROCm instructions at https://iree.dev/guides/deployment-configurations/gpu-rocm/ on Windows, running MobileNet and getting the expected outputs 🎉
This does two things:
hipDeviceCanAccessPeerbefore callinghipDeviceEnablePeerAccessso there is a chance to log a better error messageMore information
On Windows 11 with 2x w7900 and the 6.2 HIP SDK, the previous code returned
hipErrorInvalidDevicewhen callinghipDeviceEnablePeerAccess. On the same system under Linux (unknown HIP/ROCm version but pretty similar), the code works without errors. In both cases, I only requested a single device, so this peering code did not need to run at all. See also this discussion on Discord.See documentation for these APIs at https://rocm.docs.amd.com/projects/HIP/en/latest/doxygen/html/group___peer_to_peer.html.
Testing
Warning
I've only tested on the machines I have easy access to. I think we still need CI coverage for multi-device (e.g. #19995)