This is an automated email from the ASF dual-hosted git repository.

mbrookhart pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 5c2836c  Turn on Compute library testing in CI for AArch64 (#8291)
5c2836c is described below

commit 5c2836c40ef92b51a4c0917ab6a0f890617f9c1f
Author: Ramana Radhakrishnan <[email protected]>
AuthorDate: Tue Jun 22 21:37:01 2021 +0100

    Turn on Compute library testing in CI for AArch64 (#8291)
    
    * Turn on Compute library testing in CI.
    
    This pull request turns on compute library testing in CI by
    
    1. Handling import errors in Compute Library Integration.
    2. Setting the configuration to the right path for ACL.
    
    This handles import errors for packages in Compute library integration.
    This pull request allows for the AArch64 CI to pick up native
    compute library testing and tests the operators being offloaded at
    runtime.
    
    * Fix typo
    
    * Fix up use of ubuntu_install_arm_compute_lib.sh in Dockerfile.ci_arm
    
    * Move to using pre-built ACL binaries for ci_arm
    * Fixup the path for installation to be /opt/acl as it originally was.
    * Fix up the issues with paths.
    
    Once this is done ci_arm will need to be rebuilt though will continue
    to work seamlessly.
---
 docker/Dockerfile.ci_arm                           |  4 ++--
 .../ubuntu_download_arm_compute_lib_binaries.sh    |  3 ++-
 .../contrib/test_arm_compute_lib/test_network.py   | 25 +++++++++++++++++-----
 tests/scripts/task_config_build_arm.sh             |  1 +
 4 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/docker/Dockerfile.ci_arm b/docker/Dockerfile.ci_arm
index 671ce04..9479d71 100644
--- a/docker/Dockerfile.ci_arm
+++ b/docker/Dockerfile.ci_arm
@@ -43,5 +43,5 @@ COPY install/ubuntu_install_redis.sh 
/install/ubuntu_install_redis.sh
 RUN bash /install/ubuntu_install_redis.sh
 
 # Arm(R) Compute Library
-COPY install/ubuntu_install_arm_compute_lib.sh 
/install/ubuntu_install_arm_compute_lib.sh
-RUN bash /install/ubuntu_install_arm_compute_lib.sh
+COPY install/ubuntu_download_arm_compute_lib_binaries.sh 
/install/ubuntu_download_arm_compute_lib_binaries.sh
+RUN bash /install/ubuntu_download_arm_compute_lib_binaries.sh
diff --git a/docker/install/ubuntu_download_arm_compute_lib_binaries.sh 
b/docker/install/ubuntu_download_arm_compute_lib_binaries.sh
index ff8ad0e..e71cff0 100755
--- a/docker/install/ubuntu_download_arm_compute_lib_binaries.sh
+++ b/docker/install/ubuntu_download_arm_compute_lib_binaries.sh
@@ -38,7 +38,7 @@ target_lib="linux-arm64-v8a-neon"
 # target_lib="${target_lib}-asserts"
 
 extract_dir="arm_compute-${compute_lib_version}-bin-linux"
-install_path="/opt/arm/acl"
+install_path="/opt/acl"
 
 tmpdir=$(mktemp -d)
 
@@ -54,6 +54,7 @@ cd "$tmpdir"
 curl -sL "${compute_lib_download_url}" -o "${compute_lib_file_name}"
 tar xzf "${compute_lib_file_name}"
 
+rm -rf "${install_path}"
 mkdir -p "${install_path}"
 cp -r "${extract_dir}/include" "${install_path}/"
 cp -r "${extract_dir}/arm_compute" "${install_path}/include/"
diff --git a/tests/python/contrib/test_arm_compute_lib/test_network.py 
b/tests/python/contrib/test_arm_compute_lib/test_network.py
index bb44b79..8fcafe4 100644
--- a/tests/python/contrib/test_arm_compute_lib/test_network.py
+++ b/tests/python/contrib/test_arm_compute_lib/test_network.py
@@ -56,7 +56,10 @@ def _build_and_run_network(mod, params, inputs, device, 
tvm_ops, acl_partitions,
 
 def _get_tflite_model(tflite_model_path, inputs_dict):
     """Convert TFlite graph to relay."""
-    import tflite.Model
+    try:
+        import tflite.Model
+    except ImportError:
+        pytest.skip("Missing Tflite support")
 
     with open(tflite_model_path, "rb") as f:
         tflite_model_buffer = f.read()
@@ -92,7 +95,10 @@ def test_vgg16():
     device = Device()
 
     def get_model():
-        from keras.applications import VGG16
+        try:
+            from keras.applications import VGG16
+        except ImportError:
+            pytest.skip("Missing Keras Package")
 
         vgg16 = VGG16(include_top=True, weights="imagenet", input_shape=(224, 
224, 3), classes=1000)
         inputs = {vgg16.input_names[0]: ((1, 224, 224, 3), "float32")}
@@ -113,7 +119,10 @@ def test_mobilenet():
     device = Device()
 
     def get_model():
-        from keras.applications import MobileNet
+        try:
+            from keras.applications import MobileNet
+        except ImportError:
+            pytest.skip("Missing keras module")
 
         mobilenet = MobileNet(
             include_top=True, weights="imagenet", input_shape=(224, 224, 3), 
classes=1000
@@ -133,7 +142,10 @@ def test_quantized_mobilenet():
     if skip_runtime_test():
         return
 
-    import tvm.relay.testing.tf as tf_testing
+    try:
+        import tvm.relay.testing.tf as tf_testing
+    except ImportError:
+        pytest.skip("Missing Tflite support")
 
     device = Device()
 
@@ -158,7 +170,10 @@ def test_squeezenet():
     if skip_runtime_test():
         return
 
-    import tvm.relay.testing.tf as tf_testing
+    try:
+        import tvm.relay.testing.tf as tf_testing
+    except ImportError:
+        pytest.skip("Missing TF Support")
 
     device = Device()
 
diff --git a/tests/scripts/task_config_build_arm.sh 
b/tests/scripts/task_config_build_arm.sh
index b3a084a..cae2846 100755
--- a/tests/scripts/task_config_build_arm.sh
+++ b/tests/scripts/task_config_build_arm.sh
@@ -34,3 +34,4 @@ echo set\(CMAKE_CXX_FLAGS -Werror\) >> config.cmake
 echo set\(USE_VTA_TSIM ON\) >> config.cmake
 echo set\(USE_VTA_FSIM ON\) >> config.cmake
 echo set\(USE_ARM_COMPUTE_LIB ON\) >> config.cmake
+echo set\(USE_ARM_COMPUTE_LIB_GRAPH_EXECUTOR "/opt/acl"\) >> config.cmake

Reply via email to