-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[TIR][USMP] Add a parallel to serial for loop converter pass #8469
[TIR][USMP] Add a parallel to serial for loop converter pass #8469
Conversation
given the particular pass can be applied to any TIR Module, we might be able to just put it under tir namespace withour introducing the usmp namespace. |
Thanks for the contribution! Just curious, why we do such a pass instead of removing |
Hi @tqchen , Hi @junrushao1994 , |
This is an optional pass to convert all parallel for loops in TIR to serial ones for different reasons such as executor does not support parallel launch of for loops (e.g., AoT) or allocating space for parallel for loops might not be desired. * Additionally adding FFI scaffolding for USMP Change-Id: Id5e8ccb90140d2d3ae113b20a3ca152a54497c45
* remove unused import Change-Id: I29d5fdec92120418596f9dba1d6630f65620a603
*moved the pass to tir namespace Change-Id: I74720ca2f566066b3a4f22f504d8f0f684c99dc2
* fixed docstring Change-Id: I73bb9867fe2ed6a86f65666493c5c6e3edf87b49
* fixed mypy lint error Change-Id: I226ef27d5536674fbe4b2d2c6ff47b8cb3b41431
338e51a
to
26571f8
Compare
|
||
def test_nn_conv2d_add_fixed_point_multiply_clip_cast_cast_2(): | ||
primfunc = fused_nn_conv2d_add_fixed_point_multiply_clip_cast_cast_2 | ||
mod = tvm.IRModule.from_expr(primfunc) |
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.
want to assert that you find at least one kParallel for loop in here?
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.
Do we need to ? I mean its written in the test.
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.
let's consider this blocked on testing infrastructure. a common pattern in tests is for the data to be re-used in multiple tests and then lose the "why" behind the test. that's where my request is coming from.
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.
@tqchen @areusch @junrushao1994
Can we progress this one ?
|
||
def test_nn_conv2d_add_fixed_point_multiply_clip_cast_cast_2(): | ||
primfunc = fused_nn_conv2d_add_fixed_point_multiply_clip_cast_cast_2 | ||
mod = tvm.IRModule.from_expr(primfunc) |
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.
Do we need to ? I mean its written in the test.
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.
thanks @manupa-arm! cc @mbs-octoml
|
||
def test_nn_conv2d_add_fixed_point_multiply_clip_cast_cast_2(): | ||
primfunc = fused_nn_conv2d_add_fixed_point_multiply_clip_cast_cast_2 | ||
mod = tvm.IRModule.from_expr(primfunc) |
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.
let's consider this blocked on testing infrastructure. a common pattern in tests is for the data to be re-used in multiple tests and then lose the "why" behind the test. that's where my request is coming from.
Caused by apache#8469 being stale on merge when apache#9115 had changed the namespace for `tvm.script`.
…8469) * [TIR][USMP] Add a parallel to serial for loop converter pass This is an optional pass to convert all parallel for loops in TIR to serial ones for different reasons such as executor does not support parallel launch of for loops (e.g., AoT) or allocating space for parallel for loops might not be desired. * Additionally adding FFI scaffolding for USMP Change-Id: Id5e8ccb90140d2d3ae113b20a3ca152a54497c45 * [TIR][USMP] Add a parallel to serial for loop converter pass * remove unused import Change-Id: I29d5fdec92120418596f9dba1d6630f65620a603 * [TIR][USMP] Add a parallel to serial for loop converter pass *moved the pass to tir namespace Change-Id: I74720ca2f566066b3a4f22f504d8f0f684c99dc2 * [TIR][USMP] Add a parallel to serial for loop converter pass * fixed docstring Change-Id: I73bb9867fe2ed6a86f65666493c5c6e3edf87b49 * [TIR][USMP] Add a parallel to serial for loop converter pass * fixed mypy lint error Change-Id: I226ef27d5536674fbe4b2d2c6ff47b8cb3b41431
Caused by apache#8469 being stale on merge when apache#9115 had changed the namespace for `tvm.script`.
…8469) * [TIR][USMP] Add a parallel to serial for loop converter pass This is an optional pass to convert all parallel for loops in TIR to serial ones for different reasons such as executor does not support parallel launch of for loops (e.g., AoT) or allocating space for parallel for loops might not be desired. * Additionally adding FFI scaffolding for USMP Change-Id: Id5e8ccb90140d2d3ae113b20a3ca152a54497c45 * [TIR][USMP] Add a parallel to serial for loop converter pass * remove unused import Change-Id: I29d5fdec92120418596f9dba1d6630f65620a603 * [TIR][USMP] Add a parallel to serial for loop converter pass *moved the pass to tir namespace Change-Id: I74720ca2f566066b3a4f22f504d8f0f684c99dc2 * [TIR][USMP] Add a parallel to serial for loop converter pass * fixed docstring Change-Id: I73bb9867fe2ed6a86f65666493c5c6e3edf87b49 * [TIR][USMP] Add a parallel to serial for loop converter pass * fixed mypy lint error Change-Id: I226ef27d5536674fbe4b2d2c6ff47b8cb3b41431
Caused by apache#8469 being stale on merge when apache#9115 had changed the namespace for `tvm.script`.
…8469) * [TIR][USMP] Add a parallel to serial for loop converter pass This is an optional pass to convert all parallel for loops in TIR to serial ones for different reasons such as executor does not support parallel launch of for loops (e.g., AoT) or allocating space for parallel for loops might not be desired. * Additionally adding FFI scaffolding for USMP Change-Id: Id5e8ccb90140d2d3ae113b20a3ca152a54497c45 * [TIR][USMP] Add a parallel to serial for loop converter pass * remove unused import Change-Id: I29d5fdec92120418596f9dba1d6630f65620a603 * [TIR][USMP] Add a parallel to serial for loop converter pass *moved the pass to tir namespace Change-Id: I74720ca2f566066b3a4f22f504d8f0f684c99dc2 * [TIR][USMP] Add a parallel to serial for loop converter pass * fixed docstring Change-Id: I73bb9867fe2ed6a86f65666493c5c6e3edf87b49 * [TIR][USMP] Add a parallel to serial for loop converter pass * fixed mypy lint error Change-Id: I226ef27d5536674fbe4b2d2c6ff47b8cb3b41431
Caused by apache#8469 being stale on merge when apache#9115 had changed the namespace for `tvm.script`.
This is an optional pass to convert all parallel for loops in TIR to serial ones for different reasons such as executor does not support parallel launch of for loops (e.g., AoT) or allocating space for parallel for loops might not be desired.