Skip to content

Commit bc43ed4

Browse files
authored
[BYOC] [ACL] include_non_call_ops = False (#7121)
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.
1 parent 66744d9 commit bc43ed4

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

python/tvm/relay/op/contrib/arm_compute_lib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def partition_for_arm_compute_lib(mod, params=None):
6363
[
6464
transform.InferType(),
6565
transform.MergeComposite(arm_compute_lib_pattern_table()),
66-
transform.AnnotateTarget("arm_compute_lib"),
66+
transform.AnnotateTarget("arm_compute_lib", False),
6767
transform.PartitionGraph(),
6868
]
6969
)

tests/python/contrib/test_arm_compute_lib/test_network.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,32 @@ def get_model():
152152
)
153153

154154

155+
def test_squeezenet():
156+
Device.load("test_config.json")
157+
158+
if skip_runtime_test():
159+
return
160+
161+
import tvm.relay.testing.tf as tf_testing
162+
163+
device = Device()
164+
165+
def get_model():
166+
model_path = tf_testing.get_workload_official(
167+
"https://storage.googleapis.com/download.tensorflow.org/models/tflite/model_zoo/upload_20180427/squeezenet_2018_04_27.tgz",
168+
"squeezenet.tflite",
169+
)
170+
inputs = {"Placeholder": ((1, 224, 224, 3), "float32")}
171+
mod, params = _get_tflite_model(model_path, inputs_dict=inputs)
172+
return mod, params, inputs
173+
174+
_build_and_run_network(
175+
*get_model(), device=device, tvm_ops=10, acl_partitions=30, atol=8, rtol=0
176+
)
177+
178+
155179
if __name__ == "__main__":
156180
test_vgg16()
157181
test_mobilenet()
158182
test_quantized_mobilenet()
183+
test_squeezenet()

0 commit comments

Comments
 (0)