-
Notifications
You must be signed in to change notification settings - Fork 73
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
replace pyrsistent.PMap, immutables.Map, immutabledict with constantdict #884
Conversation
I haven't kept up with the immutable benchmarking and stuff. Is |
I think my constantdict package is the best ;-), but loopy is already using |
e3877cf
to
9f1132b
Compare
I'm OK with going to |
fc195f5
to
1845e94
Compare
Just a thought on my side: |
I actually like it where it is. While it seems like it is leading the pack of its competitors, it's not without issues. And IMO anyway, pytools already has too much stuff in it for its own good, it should get smaller, not bigger. |
loopy/kernel/function_interface.py
Outdated
if arg_id_to_dtype is None: | ||
arg_id_to_dtype = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure whether this is the intended behavior here (or whether arg_id_to_dtype
should just be set to None
). This bug seems to have come in with 70cc100#diff-c2536267212ab595d8fbafdc40257bf749f171cc1e23c6c5113fcf2e41546b02 (seems like typing with immutabledict is not strict enough so that mypy did not catch this earlier)
Same below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can just be assert arg_id_to_dtype is not None
(since None
is hashable, we should not end up in this branch).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed in ba93a2f
This is ready for a first look @inducer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two minor things, and then I think this is ready! 🎉
loopy/kernel/function_interface.py
Outdated
if arg_id_to_dtype is None: | ||
arg_id_to_dtype = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can just be assert arg_id_to_dtype is not None
(since None
is hashable, we should not end up in this branch).
2449f53
to
ba93a2f
Compare
Thx! |
Whoops. This should have included a data model bump: e3b96cc (see explanation in commit message). |
Followup of #832
Tree benchmark (#887) performance (Python 3.12, Mac M1):
pyrsistent.pmap
immutables.Map
constantdict
immutabledict
Please squash