Change nccl get_unique_id to return a bytes string#9438
Merged
Conversation
leofang
requested changes
Oct 28, 2025
Member
leofang
left a comment
There was a problem hiding this comment.
We should change it to return bytes +1, just need to be more careful 🙂
Contributor
|
This pull request is now in conflicts. Could you fix it @seberg? 🙏 |
This simplifies things slightly, but mostly avoids any sensitivity to systems with different char signedness. I.e. casting the `char` to an integer tuple means we get negative values on many platforms (e.g. intel/AMD CPUs) while ARM system use unsigned char and would give signed values. Using a bytes string, means that we can exchange that directly in the communicator and don't need to do the (incorrect) `+128` (rather than a cast to unsigned int). Since CuPy v14 is a major version and since nothing should change for most use-cases this seems sensible to try to just change to me.
Member
Author
|
/test mini |
Member
Author
Do prefer I add it here or we just gather it later since it's not much and avoids merge conflicts? (I had tagged it as no-compat.) |
Member
|
No opinion 🙂 But let's give @asi1024 time to take a second look before merging (since this is a no-compat). |
asi1024
approved these changes
Oct 29, 2025
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.
This simplifies things slightly, but mostly avoids any sensitivity to systems with different char signedness.
I.e. casting the
charto an integer tuple means we get negative values on many platforms (e.g. intel/AMD CPUs) while ARM system use unsigned char and would give signed values.Using a bytes string, means that we can exchange that directly in the communicator and don't need to do the (incorrect)
+128(rather than a cast to unsigned int).Since CuPy v14 is a major version and since nothing should change for most use-cases this seems sensible to try to just change to me.
Closes gh-9435, gh-9430
(I should probably to confirm this on an ARM system, although if anything the systems would fail probably and Cython generates
memcpyandFromBytesAndSize, so it should be safe.)