-
Notifications
You must be signed in to change notification settings - Fork 58
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
[BUG] Hanging when using string as tag #1049
Comments
I found the reason is that the hash() function in Python3 is not deterministic for types other than integers. I can submit a PR for it. |
Hi @cctry , I'm glad you were able to figure out the issue. Yes, we've come across this in the past as well, I can't find where this was discussed previously though. PRs are always welcome, what do you have in mind though, clarifying the documentation or something else? Unfortunately, I don't think we can do much to "resolve" this issue given it's a Python feature, the user will be required to guarantee the value is hashable and deterministic. It seems that you're also just starting with UCX-Py, I would recommend you have a look at UCXX which is a rewrite of UCX-Py in C++ but provides the same functionality as UCX-Py (in some cases, minor changes are required). We will later in the year deprecate and archive UCX-Py in favor of UCXX. |
Thank you for letting me know UCXX! I think we can use other hash functions like md5 to replace hash(). Python salts it to reduce the predicability which is exactly what we need in the tagged messages. |
Can you explain why you're saying reduced predictability is exactly what we need? I'd argue the exact opposite, the tag must be deterministic and thus we don't want to reduce predictability. Tags are necessary to match the message on the receiving end, so it must be exactly the same as the sender (or must match a mask, but that is not currently exposed in UCX-Py's async API). Depending on your needs I would also suggest looking at active message, in which case communication is entirely tracked endpoint<->endpoint and there's no need for tags. See |
I think ambiguity of english :).
Here the clarifying subclause (starting with "which") can be read ambiguously (Strunk and White have an example for effectively exactly this): does it relate to "Python salts it", or does it relate to "predictability". I believe @cctry means "Python salts it to reduce predictability, and predictability is exactly what we need", whereas @pentschev has read this as "Python salts it to reduce predictability, and reduced predictability is exactly what we need". |
But, I would just send integers as the message tag, and perhaps we should clarify in the documentation that that is what one should do. |
Hello,
My program hangs when using string as the tag.
Client code
Server code
Replacing the above
str(flag)
withflag
resolves the hanging.The debug log of client indicates that it tries to resend the message
The server waits after allocating
The text was updated successfully, but these errors were encountered: