You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/04/27 18:24:34 UTC

[GitHub] [tvm] driazati commented on a diff in pull request #11140: [CI] Enable CI to get and build the latest oneDNN release

driazati commented on code in PR #11140:
URL: https://github.com/apache/tvm/pull/11140#discussion_r860120569


##########
docker/install/ubuntu_install_dnnl.sh:
##########
@@ -20,10 +20,38 @@ set -e
 set -u
 set -o pipefail
 
-cd /usr/local/
-wget -q https://github.com/oneapi-src/oneDNN/releases/download/v2.2/dnnl_lnx_2.2.0_cpu_gomp.tgz
-tar -xzf dnnl_lnx_2.2.0_cpu_gomp.tgz
-mv dnnl_lnx_2.2.0_cpu_gomp/include/* /usr/local/include/
-mv dnnl_lnx_2.2.0_cpu_gomp/lib/libdnnl* /usr/local/lib/
-rm -rf dnnl_lnx_2.2.0_cpu_gomp.tgz dnnl_lnx_2.2.0_cpu_gomp
-cd -
+pre_dir=`pwd`
+
+build_dir="/usr/local/"
+install_dir="/usr/local/"
+
+cd ${build_dir}
+rls_tag=$(curl -s https://github.com/oneapi-src/oneDNN/releases/latest \
+    | cut -d '"' -f 2 \
+    | grep -o '[^\/]*$')
+dnnl_ver=`echo ${rls_tag} | sed 's/v//g'`
+echo "The latest oneDNN release is version ${dnnl_ver} with tag '${rls_tag}'"
+
+tar_file="${rls_tag}.tar.gz"
+src_dir="${build_dir}/oneDNN-${dnnl_ver}"
+
+if [ -d ${src_dir} ]; then
+    echo "source files exist."
+else
+    if [ -f ${tar_file} ]; then
+        echo "${tar_file} exists, skip downloading."
+    else 
+        echo "downloading ${tar_file}."
+        tar_url="https://github.com/oneapi-src/oneDNN/archive/refs/tags/${tar_file}"
+        wget ${tar_url}
+    fi
+    tar -xzvf ${tar_file}
+fi
+
+cd ${src_dir}
+cmake . -DCMAKE_INSTALL_PREFIX=${install_dir} && make -j16 && make install

Review Comment:
   nit: use all available CPUs
   ```suggestion
   NPROC=$(nproc)
   cmake . -GNinja -DCMAKE_INSTALL_PREFIX=${install_dir}
   make -j"$NPROC"
   make install
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org