Skip to content

Instantly share code, notes, and snippets.

@leshikus
Last active April 12, 2024 21:02
Show Gist options
  • Save leshikus/a10914a9a5e789b89cf54404901214af to your computer and use it in GitHub Desktop.
Save leshikus/a10914a9a5e789b89cf54404901214af to your computer and use it in GitHub Desktop.
Compile triton with conda
set -euvx
name=${1:-triton}
rm -rf intel-xpu-backend-for-triton/ llvm packages/ ~/.triton/cache intel-extension-for-pytorch pytorch
git clone https://github.com/intel/intel-xpu-backend-for-triton -b lesh/3/add-conda-basekit
set +uvx
. ~/.conda/etc/profile.d/conda.sh
#conda deactivate
conda env remove -n $name
set -uvx
set -e
conda create -y -n triton python=3.9.*
conda env update -n $name -f intel-xpu-backend-for-triton/scripts/triton.yml
conda env update -n $name -f intel-xpu-backend-for-triton/scripts/basekit.yml
export LD_LIBRARY_PATH=/home/jovyan/.conda/envs/triton/lib:$LD_LIBRARY_PATH
ln -snf /usr/include/level_zero ~/.conda/envs/triton/bin/../x86_64-conda-linux-gnu/sysroot/usr/include/level_zero
find /usr -name libze_\* -exec ln -sf {} ~/.conda/envs/triton/lib/ \;
cd intel-xpu-backend-for-triton/
conda run --no-capture-output -n $name scripts/compile-triton.sh --triton 2>&1 | tee ../$name.log
conda install -y -n triton dpcpp_linux-64
conda run --no-capture-output -n $name bash -v -x scripts/test-triton.sh 2>&1 | tee -a ../$name.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment