Skip to content

Instantly share code, notes, and snippets.

@briansp2020
Created November 19, 2023 04:58
Show Gist options
  • Save briansp2020/1e8c3e5735087398ebfd9514f26a0007 to your computer and use it in GitHub Desktop.
Save briansp2020/1e8c3e5735087398ebfd9514f26a0007 to your computer and use it in GitHub Desktop.
Build TensorFlow r2.14
#/bin/sh
cd
export HSA_OVERRIDE_GFX_VERSION=11.0.0
export PYTORCH_ROCM_ARCH="gfx1100"
export HIP_VISIBLE_DEVICES=0
export ROCM_PATH=/opt/rocm
echo "export HSA_OVERRIDE_GFX_VERSION=11.0.0" | tee --append .bashrc
echo "export PYTORCH_ROCM_ARCH=\"gfx1100\"" | tee --append .bashrc
echo "export HIP_VISIBLE_DEVICES=0" | tee --append .bashrc
echo "export ROCM_PATH=/opt/rocm" | tee --append .bashrc
python3 -m venv tf
source ~/tf/bin/activate
# install bazel 6.1
apt install apt-transport-https curl gnupg -y
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor >bazel-archive-keyring.gpg
mv bazel-archive-keyring.gpg /usr/share/keyrings
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/bazel-archive-keyring.gpg] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list
apt update && apt install -y bazel-6.1.0
ln -s /usr/bin/bazel-6.1.0 /usr/bin/bazel
apt install rocm-dev patchelf libboost-filesystem-dev -y
# Install updated rocPRIM
#cd ~
#git clone https://github.com/briansp2020/rocPRIM
#cd rocPRIM; mkdir build; cd build
#CXX=hipcc cmake -DBUILD_BENCHMARK=ON ../.
#make -j $(nproc)
#make install
# Build Tensorflow 2.14
cd ~
git clone https://github.com/ROCmSoftwarePlatform/tensorflow-upstream
cd tensorflow-upstream
git checkout r2.14-rocm-enhanced
#sed -i 's/5.7.0/5.7.1/g' build_rocm_python3
sed -i 's/"gfx1030" /"gfx1030",/g' tensorflow/compiler/xla/stream_executor/device_description.h
./build_rocm_python3
@dmikushin
Copy link

Hi, thanks for the script. For gfx1100 there will be no KDB for MIOpen. Without KDB, the best choices of parameters won't be know. How much performance impact does it have, according to your experience?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment