Skip to content

Commit

Permalink
[BYOC] [ACL] include_non_call_ops = False (apache#7121)
Browse files Browse the repository at this point in the history
ACL codegen now uses AnnotateTarget pass with include_non_call_ops = False
to prevent promoting non-call ops under the target of its arguments.
Squeezenet unit test added.
  • Loading branch information
d-smirnov authored and tkonolige committed Jan 11, 2021
1 parent 090006d commit 6f7ee25
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion python/tvm/relay/op/contrib/arm_compute_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def partition_for_arm_compute_lib(mod, params=None):
[
transform.InferType(),
transform.MergeComposite(arm_compute_lib_pattern_table()),
transform.AnnotateTarget("arm_compute_lib"),
transform.AnnotateTarget("arm_compute_lib", False),
transform.PartitionGraph(),
]
)
Expand Down
25 changes: 25 additions & 0 deletions tests/python/contrib/test_arm_compute_lib/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,32 @@ def get_model():
)


def test_squeezenet():
Device.load("test_config.json")

if skip_runtime_test():
return

import tvm.relay.testing.tf as tf_testing

device = Device()

def get_model():
model_path = tf_testing.get_workload_official(
"https://storage.googleapis.com/download.tensorflow.org/models/tflite/model_zoo/upload_20180427/squeezenet_2018_04_27.tgz",
"squeezenet.tflite",
)
inputs = {"Placeholder": ((1, 224, 224, 3), "float32")}
mod, params = _get_tflite_model(model_path, inputs_dict=inputs)
return mod, params, inputs

_build_and_run_network(
*get_model(), device=device, tvm_ops=10, acl_partitions=30, atol=8, rtol=0
)


if __name__ == "__main__":
test_vgg16()
test_mobilenet()
test_quantized_mobilenet()
test_squeezenet()

0 comments on commit 6f7ee25

Please sign in to comment.