-
Notifications
You must be signed in to change notification settings - Fork 621
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
Add NumbaFunc operator #2804
Add NumbaFunc operator #2804
Conversation
This pull request introduces 3 alerts when merging 2bf15523f2178321cd145ed374578f3b50ea965a into 852ad4e - view on LGTM.com new alerts:
|
Signed-off-by: Rafal Maj <rmaj@nvidia.com>
Signed-off-by: Rafal Maj <rmaj@nvidia.com>
Signed-off-by: Rafal Maj <rmaj@nvidia.com>
Signed-off-by: Rafal Maj <rmaj@nvidia.com>
Signed-off-by: Rafal Maj <rmaj@nvidia.com>
Signed-off-by: Rafal Maj <rmaj@nvidia.com>
Signed-off-by: Rafal Maj <rmaj@nvidia.com>
Signed-off-by: Rafal Maj <rmaj@nvidia.com>
Signed-off-by: Rafal Maj <rmaj@nvidia.com>
Signed-off-by: Rafal Maj <rmaj@nvidia.com>
Signed-off-by: Rafal Maj <rmaj@nvidia.com>
Signed-off-by: Rafal Maj <rmaj@nvidia.com>
Signed-off-by: Rafal Maj <rmaj@nvidia.com>
Signed-off-by: Rafal Maj <rmaj@nvidia.com>
Signed-off-by: Rafal Maj <rmaj@nvidia.com>
!build |
CI MESSAGE: [2203528]: BUILD STARTED |
CI MESSAGE: [2203528]: BUILD PASSED |
.. code-block:: python | ||
|
||
@cfunc(setup_fn_sig(num_outputs, num_inputs), nopython=True) | ||
def callback_setup_func(out1_shape_ptr, out1_ndim, out_dtype_ptr, in1_shape_ptr, in1_ndim, in1_dtype, num_samples) |
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.
Food for thoughts.
How to approach case when you cannot calculate the shape without the access to the input data - like WarpAffine or even Rotate what may extend canvas?
|
||
.. code-block:: python | ||
|
||
@cfunc(run_fn_sig([out_numba_types], [in_numba_types]), nopython=True) |
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.
Can we somehow validate if [out_numba_types], [in_numba_types]
matches what callback_setup_func
returns?
How about validating the input of the operator inside DALI?
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.
Looks good. I'm not sure how this behaves in some more advanced Numba workflows (like chaining functions, callback to Python etc.) and they are not explicitly disallowed here, but this will be probably handled in later PRs.
test_data_root = get_dali_extra_path() | ||
lmdb_folder = os.path.join(test_data_root, 'db', 'lmdb') | ||
|
||
@cfunc(dali_numba.run_fn_sig(types.uint8, types.uint8), nopython=True) |
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 I would be neat to make a decorator that turns a function into NumbaFunc
operator. Then we can use it in graph definition. But this is for later PR for sure.
!build |
CI MESSAGE: [2221186]: BUILD STARTED |
CI MESSAGE: [2221186]: BUILD PASSED |
Why we need this PR?
What happened in this PR?
JIRA TASK: DALI-1921