-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Dict type in nopython mode #2096
Comments
Just wanted to say that this would be really nice (I have some code right now which could be made considerably faster if there was some API I could use for caching to skip some computation -- I even tried creating an int->int hashtable for my use case and couldn't really find a good way to do it in nopython mode as it's not possible to create something as [[(int, int)]]) for the buckets). |
This feature would be awesome. |
+1. |
While I would also love support for typed dicts in https://github.com/synapticarbors/khash_numba Maybe this will be useful to some people in the interim. Depending on the number of unique elements that are being mapped, it looks like it is often faster to use a numpy array (trading speed for increased memory consumption), but there are definitely cases where this solution looks to be better. |
Very nice interim measure! Thanks! |
Is there any news on this? I have tons of lookup tables which I want to use in my jitted functions... This features would be huge! |
We just ran into needing this for our custom-rolled DOK implementation over in pydata/sparse#126. It'd be a big help if it was added. |
I would also like to register my vote for dictionary support in Numba. My use case is as follows: I have been writing graph neural network models using numpy + autograd, and I would like to be able to see JIT compilation of my for-loop intensive code. (Long story cut short, I am looping over pairs of matrices to get around an inability to use block sparse matrices with autograd.) The parameters that I optimize are stored in a dictionary, so that I can access them by name in each function layer of the neural network. |
@ericmjl meanwhile you can try the Julia language (sorry for advertising) ;) It's JIT, python-like syntax and C-speed. Talks to Python without significant overhead. |
Dictionary support is on our roadmap (just being reviewed now in #3617) for first half of 2019. |
@seibert thank you for letting us know! 😄 🎉 |
Cool, included in 0.43 as experimental feature 🎉, thank you! |
@sklam think you should have the honour of closing this :) |
Closing this. We now have a typed dictionary since 0.43. |
👍 😄 😸 ! |
This is so cool. However, is there anyway I can get around nested dictionaries? |
@Avik1993 Please could you clarify what you mean and open a new issue with an example of what you want to do but does not work at present, thanks. |
Hash tables are very useful, and would be nice in nopython mode.
The text was updated successfully, but these errors were encountered: