-
Notifications
You must be signed in to change notification settings - Fork 609
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
Numba func notebook #2886
Numba func notebook #2886
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@@ -0,0 +1,374 @@ | |||
{ |
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 if it won't be easier to pass the types and ndims in the pipeline definition itself. Either way, please explain it why we do it and what the passed values mean. Probably mention that we do not adjust ndim for batch mode.
Reply via ReviewNB
"\n", | ||
"This function is compiled. It should be able to work in [nopython](https://numba.pydata.org/numba-doc/latest/user/5minguide.html#what-is-nopython-mode) mode.\n", | ||
"\n", | ||
"#### Define the processing function that fills the output sample base on the input sample" |
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.
"#### Define the processing function that fills the output sample base on the input sample" | |
"#### Define the processing function that fills the output sample based on the input sample" |
"id": "impossible-ticket", | ||
"metadata": {}, | ||
"source": [ | ||
"The run function can have more than one input or output. The function with `n` outputs and `m` inputs should have following definition:\n", |
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.
maybe signature
instead of definition
?
"metadata": {}, | ||
"source": [ | ||
"### Multiple inputs and outputs\n", | ||
"\"The numba function operator can take up to 6 inputs and produce up to 6 outputs. As an example, let us write a pipeline that takes an image and splits the RGB channels into 3 separate outputs\n", |
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.
You have additional "
in text here.
Please mention the |
d4d84bb
to
72b625c
Compare
!build |
CI MESSAGE: [2309134]: BUILD STARTED |
CI MESSAGE: [2309134]: BUILD PASSED |
Sorry I didn't spot it earlier, but can you move this file to docs/examples/custom_operations |
!build |
CI MESSAGE: [2312814]: BUILD STARTED |
CI MESSAGE: [2312814]: BUILD PASSED |
@@ -0,0 +1,468 @@ | |||
{ |
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.
presents -> shows (we present that the tutorial)
user function -> user-defined function
foreign C code -> external C code
utils -> utilities (no jargon)
Reply via ReviewNB
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.
custom operations written as a Numba JIT-compiled functions.
@@ -0,0 +1,468 @@ | |||
{ |
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.
pipeline which rotates images by 90 degrees
Since the output shape will be different than the input shape
In the setup function, we define the output
shapes of the outputs are the same as the in the inputs.
Reply via ReviewNB
@@ -0,0 +1,468 @@ | |||
{ |
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.
and a list of input shapes, which contains the input shape
The first dimension is the index of the output/input
It's not a multidimensional array, but a nested list. I'd rephrase it:
The outer index applied to outs/ins is the index of the respective output/input; the inner index indicates the sample in the batch.
Reply via ReviewNB
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>
8a5e02a
to
a797cfb
Compare
!build |
CI MESSAGE: [2336829]: BUILD STARTED |
CI MESSAGE: [2336829]: BUILD FAILED |
!build |
CI MESSAGE: [2336909]: BUILD STARTED |
CI MESSAGE: [2336909]: BUILD FAILED |
CI MESSAGE: [2336988]: BUILD STARTED |
CI MESSAGE: [2336989]: BUILD STARTED |
CI MESSAGE: [2336988]: BUILD FAILED |
CI MESSAGE: [2336989]: BUILD FAILED |
CI MESSAGE: [2337008]: BUILD STARTED |
CI MESSAGE: [2337011]: BUILD STARTED |
CI MESSAGE: [2337008]: BUILD FAILED |
CI MESSAGE: [2337008]: BUILD PASSED |
Why we need this PR?
What happened in this PR?
NA
NA
Clear explanation of numba_func in notebook
NA
NA
JIRA TASK: DALI-1935