Skip to content

[AutoTVM] Tuning fails for an NHWC network on Arm CPU #4542

@mbaret

Description

@mbaret

I'm trying to tune NHWC networks produced by the tflite frontend, but they fail with the error AssertionError: only support NCHW/HWCN currently. This suggests to me the AlterOpLayout pass is not happening during task extraction. I can force the AlterOpLayout pass to happen using the following patch:

--- a/python/tvm/autotvm/task/relay_integration.py
+++ b/python/tvm/autotvm/task/relay_integration.py
@@ -49,7 +49,9 @@ def _lower(func,
                 grc = graph_runtime_codegen.GraphRuntimeCodegen(None, target)
                 return grc.codegen(mod["main"])
     # default case
-    mod, _ = relay.optimize(func, target, params)
+    with relay.build_config(opt_level=3):
+        mod, _ = relay.optimize(func, target, params)
+
     grc = graph_runtime_codegen.GraphRuntimeCodegen(None, target)
     return grc.codegen(mod["main"])

which does fix this issue. Am I doing something wrong in AutoTVM or is this patch necessary?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions