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

[frontend] Sort signature/constants when hashing #3258

Merged
merged 1 commit into from
Mar 9, 2024

Conversation

bertmaher
Copy link
Collaborator

I'm trying to maximize the number of (distributed) cache hits I'm getting on kernels, and dictionary iteration order seems like a possible randomizing factor.

I don't think there's technically a problem here, because Python now guarantees insertion ordering and I don't see a way the ordering here could vary, since they're argument-index ordered.

But it also feels like a reasonable sort of belt-and-suspenders protection against this being randomized, and this sort should be low-cost since it's just done at kernel compile time.

I'm trying to maximize the number of (distributed) cache hits I'm getting on
kernels, and dictionary iteration order seems like a possible randomizing
factor.

I don't think there's *technically* a problem here, because Python now
guarantees insertion ordering and I don't see a way the ordering here could
vary, since they're argument-index ordered.

But it also feels like a reasonable sort of belt-and-suspenders protection
against this being randomized, and this sort should be low-cost since it's just
done at kernel compile time.
@bertmaher bertmaher requested a review from ptillet as a code owner March 1, 2024 16:37
@bertmaher
Copy link
Collaborator Author

I'm totally not wedded to this btw, if y'all don't think it's worth doing I won't land it. It was just something that stuck out to me while I was debugging why I was getting so many cache misses.

Copy link
Collaborator

@jlebar jlebar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is reasonable. Maybe things happen in a different order or something.

@ptillet ptillet merged commit 1ecbc27 into triton-lang:main Mar 9, 2024
4 checks passed
htyu pushed a commit to htyu/triton that referenced this pull request Mar 20, 2024
I'm trying to maximize the number of (distributed) cache hits I'm
getting on kernels, and dictionary iteration order seems like a possible
randomizing factor.

I don't think there's *technically* a problem here, because Python now
guarantees insertion ordering and I don't see a way the ordering here
could vary, since they're argument-index ordered.

But it also feels like a reasonable sort of belt-and-suspenders
protection against this being randomized, and this sort should be
low-cost since it's just done at kernel compile time.
karupayun pushed a commit to openxla/triton that referenced this pull request Apr 3, 2024
I'm trying to maximize the number of (distributed) cache hits I'm
getting on kernels, and dictionary iteration order seems like a possible
randomizing factor.

I don't think there's *technically* a problem here, because Python now
guarantees insertion ordering and I don't see a way the ordering here
could vary, since they're argument-index ordered.

But it also feels like a reasonable sort of belt-and-suspenders
protection against this being randomized, and this sort should be
low-cost since it's just done at kernel compile time.
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.

3 participants