Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolaLancellotti committed May 6, 2022
1 parent 0766866 commit 367cdc9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/tvm/relay/backend/contrib/ethosu/tir/passes.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ def CopyComputeReordering(max_copy_movements: Optional[int] = None) -> tvm.IRMod
----------
max_copy_movements: Optional[int]
The maximum number of movements allowed for a copy.
If None, the pass context option tir.copy_compute_reordering_max_copy_movements
If None, the pass context option tir.ethosu.copy_compute_reordering_max_copy_movements
is used if provided, otherwise the default value will be 1.
Returns
Expand Down
4 changes: 2 additions & 2 deletions src/tir/contrib/ethosu/passes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace tvm {
* \brief The maximum number of movements allowed for a copy in the CopyComputeReordering pass.
*/
constexpr const char* kCopyComputeReorderingMaxCopyMovements =
"tir.copy_compute_reordering_max_copy_movements";
"tir.ethosu.copy_compute_reordering_max_copy_movements";
TVM_REGISTER_PASS_CONFIG_OPTION(kCopyComputeReorderingMaxCopyMovements, Integer);

namespace tir {
Expand Down Expand Up @@ -197,7 +197,7 @@ class CopyComputeReorderingMutator : public StmtExprMutator {
* and computes happen in parallel.
*
* \param max_copy_movements: The maximum number of movements allowed for a copy.
* If None, the pass context option tir.copy_compute_reordering_max_copy_movements
* If None, the pass context option tir.ethosu.copy_compute_reordering_max_copy_movements
* is used if provided, otherwise the default value will be 1.
* \return tvm::transform::Pass
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,9 @@ def main() -> None:
T.evaluate(T.call_extern("ethosu_conv2d", "int8", 214, 114, 5, 214, 0, 114, p4[0], 0, 0, 0, T.float32(0.0174839), -128, "NHCWB16", 1824, 16, 1, "int8", 214, 114, 3, 214, 0, 114, buffer3[0], 0, 0, 0, T.float32(0.104816), -128, "NHWC", 342, 3, 1, 3, 1, 1, 1, 1, 2, p5[0], 96, 0, p6[0], 32, 0, 1, 0, 1, "CLIP", -128, 127, "TFL", "NONE", 0, 0, 0, dtype="handle"))
# fmt: on

with tvm.transform.PassContext(config={"tir.copy_compute_reordering_max_copy_movements": 2}):
with tvm.transform.PassContext(
config={"tir.ethosu.copy_compute_reordering_max_copy_movements": 2}
):
test_mod = CopyComputeReordering()(OperatorsWithAndWithoutWeights)
reference_mod = ReferenceModule
tvm.ir.assert_structural_equal(test_mod, reference_mod, True)
Expand Down

0 comments on commit 367cdc9

Please sign in to comment.