diff --git a/3rdparty/tvm b/3rdparty/tvm index b63fba41c..072a5a12a 160000 --- a/3rdparty/tvm +++ b/3rdparty/tvm @@ -1 +1 @@ -Subproject commit b63fba41c22d6a1edb0ef4832be272fac68c8968 +Subproject commit 072a5a12a41ab4eeb0eb4061574cbaf9fea46642 diff --git a/install.sh b/install.sh index a1cb47b69..99fd89b8c 100755 --- a/install.sh +++ b/install.sh @@ -12,7 +12,9 @@ IS_AARCH64=false EXTRACT_PATH="3rdparty" UBUNTU_VERSION="16.04" -if [[ "$LLVM_VERSION" > "16.0.0" ]]; then +if [[ "$LLVM_VERSION" > "17.0.0" ]]; then + UBUNTU_VERSION="22.04" +elif [[ "$LLVM_VERSION" > "16.0.0" ]]; then UBUNTU_VERSION="20.04" elif [[ "$LLVM_VERSION" > "13.0.0" ]]; then UBUNTU_VERSION="18.04" diff --git a/install_amd.sh b/install_amd.sh new file mode 100755 index 000000000..052281588 --- /dev/null +++ b/install_amd.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +# install requirements +pip install -r requirements.txt + +# determine if root +USER_IS_ROOT=false +if [ "$EUID" -e 0 ]; then + USER_IS_ROOT=true +fi + +if $USER_IS_ROOT; then + wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc + echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main" >> /etc/apt/sources.list + echo "deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main" >> /etc/apt/sources.list + apt-get install llvm-16 +else + wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc + echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main" | sudo tee /etc/apt/sources.list + echo "deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main" | sudo tee /etc/apt/sources.list + sudo apt-get install llvm-16 +fi + +# clone and build tvm +git submodule update --init --recursive + +cd 3rdparty/tvm +if [ -d build ]; then + rm -rf build +fi +mkdir build +cp cmake/config.cmake build +cd build +echo "set(USE_LLVM llvm-config-16)" >> config.cmake && echo "set(USE_ROCM /opt/rocm)" >> config.cmake + +cmake .. && make -j && cd ../../.. + +echo "export TVM_HOME=$(pwd)/3rdparty/tvm" >> ~/.bashrc +echo "export PYTHONPATH=\$TVM_HOME/python:$(pwd):\$PYTHONPATH" >> ~/.bashrc +echo "export CUDA_DEVICE_ORDER=PCI_BUS_ID" >> ~/.bashrc +source ~/.bashrc diff --git a/maint/scripts/installation.sh b/maint/scripts/installation.sh index c3bb0fe0b..99fd89b8c 100755 --- a/maint/scripts/installation.sh +++ b/maint/scripts/installation.sh @@ -12,7 +12,9 @@ IS_AARCH64=false EXTRACT_PATH="3rdparty" UBUNTU_VERSION="16.04" -if [[ "$LLVM_VERSION" > "16.0.0" ]]; then +if [[ "$LLVM_VERSION" > "17.0.0" ]]; then + UBUNTU_VERSION="22.04" +elif [[ "$LLVM_VERSION" > "16.0.0" ]]; then UBUNTU_VERSION="20.04" elif [[ "$LLVM_VERSION" > "13.0.0" ]]; then UBUNTU_VERSION="18.04" @@ -65,5 +67,5 @@ cmake .. && make -j && cd ../../.. echo "export TVM_HOME=$(pwd)/3rdparty/tvm" >> ~/.bashrc echo "export PYTHONPATH=\$TVM_HOME/python:$(pwd):\$PYTHONPATH" >> ~/.bashrc - +echo "export CUDA_DEVICE_ORDER=PCI_BUS_ID" >> ~/.bashrc source ~/.bashrc