Skip to content

Commit

Permalink
[AMD][HIP] Add HIP Code Generation with Block Primitives from Composa…
Browse files Browse the repository at this point in the history
…ble kernel Tile (#223)

* Refactor Simplify function to handle multiple functions in IRModule

* Update submodule commit reference

* Add CUDA_DEVICE_ORDER environment variable to bashrc

* test fix

* lint fix

* Refactor test_general_matmul_bf16.py to use bitblas.testing.main()

* Update submodule commit reference

* Update Ubuntu version in install scripts based on LLVM version

* Update Ubuntu version in install scripts based on LLVM version

* Update submodule commit reference

* Update submodule commit reference

* Update submodule commit reference

* Update submodule commit reference
  • Loading branch information
LeiWang1999 authored Oct 29, 2024
1 parent 6a96f2b commit 1f8a100
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 4 deletions.
4 changes: 3 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
44 changes: 44 additions & 0 deletions install_amd.sh
Original file line number Diff line number Diff line change
@@ -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
6 changes: 4 additions & 2 deletions maint/scripts/installation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

0 comments on commit 1f8a100

Please sign in to comment.