You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by ar...@apache.org on 2021/05/12 21:18:37 UTC

[tvm] branch main updated: [DOCKER, CI] Add PAPI to docker images (#8016)

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

areusch 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 5547163  [DOCKER,CI] Add PAPI to docker images (#8016)
5547163 is described below

commit 55471632d97bb9d0d4535bd977ca4fb7e7cdcc28
Author: Tristan Konolige <tr...@gmail.com>
AuthorDate: Wed May 12 14:18:24 2021 -0700

    [DOCKER,CI] Add PAPI to docker images (#8016)
---
 docker/Dockerfile.ci_cpu              |  3 +++
 docker/Dockerfile.ci_gpu              |  4 ++++
 docker/install/ubuntu_install_papi.sh | 33 +++++++++++++++++++++++++++++++++
 3 files changed, 40 insertions(+)

diff --git a/docker/Dockerfile.ci_cpu b/docker/Dockerfile.ci_cpu
index 6cfee8c..1ca592f 100644
--- a/docker/Dockerfile.ci_cpu
+++ b/docker/Dockerfile.ci_cpu
@@ -36,6 +36,9 @@ RUN bash /install/ubuntu1804_install_llvm.sh
 COPY install/ubuntu_install_dnnl.sh /install/ubuntu_install_dnnl.sh
 RUN bash /install/ubuntu_install_dnnl.sh
 
+COPY install/ubuntu_install_papi.sh /install/ubuntu_install_papi.sh
+RUN bash /install/ubuntu_install_papi.sh ""
+
 # Install MxNet for access to Gluon Model Zoo.
 COPY install/ubuntu_install_mxnet.sh /install/ubuntu_install_mxnet.sh
 RUN bash /install/ubuntu_install_mxnet.sh
diff --git a/docker/Dockerfile.ci_gpu b/docker/Dockerfile.ci_gpu
index 484b0a3..96324c4 100644
--- a/docker/Dockerfile.ci_gpu
+++ b/docker/Dockerfile.ci_gpu
@@ -102,6 +102,10 @@ RUN bash /install/ubuntu_install_nnpack.sh
 COPY install/ubuntu_install_universal.sh /install/ubuntu_install_universal.sh
 RUN bash /install/ubuntu_install_universal.sh
 
+# PAPI profiling deps
+COPY install/ubuntu_install_papi.sh /install/ubuntu_install_papi.sh
+RUN bash /install/ubuntu_install_papi.sh "cuda rocm"
+
 # Environment variables
 ENV PATH=/usr/local/nvidia/bin:${PATH}
 ENV PATH=/usr/local/cuda/bin:${PATH}
diff --git a/docker/install/ubuntu_install_papi.sh b/docker/install/ubuntu_install_papi.sh
new file mode 100644
index 0000000..713312e
--- /dev/null
+++ b/docker/install/ubuntu_install_papi.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -e
+set -u
+set -o pipefail
+
+apt-get update --fix-missing
+
+# deps
+apt-get install -y linux-tools-common linux-tools-generic
+
+cd /
+git clone https://bitbucket.org/icl/papi.git
+cd papi/src
+export PAPI_CUDA_ROOT=/usr/local/cuda
+./configure --with-components="$1"
+make -j $(nproc) && make install