You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to breakdown this project and would appreciate if someone can guide me in the right direction.
I see some functions like empty(), zeroes() are supported. I also saw issues through the numpy label to implement numpy.clip() and numpy.size().
Is this project about implementing various routines found at https://numpy.org/doc/stable/reference/routines.html . If yes, we can discuss about which Array creation/manipulation routines we want to prioritize. Also some popular NumPy mathematical modules or decorators for array operations (like @vectorize) can be added.
@rebcabin I observed a lot of your work in the issue tracker uses Numpy. Would be great if you chime in here and mention any numpy intrinsics you would like to be implemented. Thanks !
I would like to summarize the target of the project for my own understanding, kindly guide me if I am deviating from the goal here.
Let's say we want to use a trigo functions from numpy like sin(x). For a snippet like -
So we already are able to generate the ASR, from lpython_instrinsic_numpy.py file but we want this to be handled by the instantiate_Sin/ create_Sin functions from intrinsic_function_registry.h.
This should be updated to instead create the Sin intrinsic as IntrinsicElementalFunction in ASR, and it should be done in https://github.com/lcompilers/lpython/blob/main/src/lpython/semantics/python_ast_to_asr.cpp.
Activity
faze-geek commentedon Feb 4, 2024
I was trying to breakdown this project and would appreciate if someone can guide me in the right direction.
I see some functions like
empty(),zeroes()are supported. I also saw issues through thenumpylabel to implementnumpy.clip()andnumpy.size().Is this project about implementing various routines found at https://numpy.org/doc/stable/reference/routines.html . If yes, we can discuss about which Array creation/manipulation routines we want to prioritize. Also some popular NumPy mathematical modules or decorators for array operations (like
@vectorize) can be added.certik commentedon Feb 5, 2024
Yes.
We can prioritize those that we already support in ASR.
faze-geek commentedon Feb 11, 2024
I would like to have some clarity on this.
Following the
numpylabel I come across the 2 files supportingnumpyfunctions.https://github.com/lcompilers/lpython/blob/main/src/runtime/lpython_intrinsic_numpy.py - Containing all mathematical and trigonometric routines (all of them follow the intrinsic architecture in
src/libasr/pass/intrinsic_function_registry.h).https://github.com/lcompilers/lpython/blob/main/src/lpython/semantics/python_ast_to_asr.cpp - Containing
numpyarray creation routines likeempty(),size()etc. (not ported to the intrinsic function files yet).Which functions are to be focussed upon and implemented via ASR?
faze-geek commentedon Feb 12, 2024
@rebcabin I observed a lot of your work in the issue tracker uses
Numpy. Would be great if you chime in here and mention any numpy intrinsics you would like to be implemented. Thanks !faze-geek commentedon Feb 16, 2024
I would like to summarize the target of the project for my own understanding, kindly guide me if I am deviating from the goal here.
Let's say we want to use a trigo functions from
numpylikesin(x). For a snippet like -Right now, this is handled here and due to the
@vectorizedecorator we are able to handle array inputs.lpython/src/runtime/lpython_intrinsic_numpy.py
Lines 9 to 12 in 6098157
So we already are able to generate the ASR, from
lpython_instrinsic_numpy.pyfile but we want this to be handled by the instantiate_Sin/ create_Sin functions fromintrinsic_function_registry.h.certik commentedon Feb 16, 2024
This should be updated to instead create the
Sinintrinsic asIntrinsicElementalFunctionin ASR, and it should be done inhttps://github.com/lcompilers/lpython/blob/main/src/lpython/semantics/python_ast_to_asr.cpp.