Skip to content

Commit e983dc2

Browse files
committed
fix: Link pytorch build files.
1 parent e12bc19 commit e983dc2

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

.github/workflows/haskell-ci.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,29 @@ jobs:
6262
- name: apt-get install
6363
run: |
6464
apt-get update
65-
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo6 libncurses-dev
65+
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo6 libncurses-dev python3 sed
6666
export LIBTORCH_HOME=$XDG_CACHE_HOME/libtorch
6767
echo "XDG_CACHE_HOME=$XDG_CACHE_HOME" >> "$GITHUB_ENV"
6868
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> "$GITHUB_ENV"
6969
echo "LIBTORCH_HOME=$LIBTORCH_HOME" >> "$GITHUB_ENV"
70+
export PYTHON=python3
71+
git clone https://github.com/pytorch/pytorch.git
72+
pushd ./pytorch
73+
export VERSION=2.5.0
74+
git pull origin v$VERSION
75+
git checkout v$VERSION
76+
mkdir build
77+
$PYTHON -m pip install --user pyyaml
78+
$PYTHON -m pip install --user dataclasses
79+
$PYTHON -m pip install --user typing_extensions
80+
$PYTHON -m torchgen.gen -s aten/src/ATen -d build/aten/src/ATen
81+
sed -i -e "s/::std::/std::/g" build/aten/src/ATen/Declarations.yaml
82+
sed -i -e "s/ name: n$/ name: 'n'/g" -e "s/ name: N$/ name: 'N'/g" build/aten/src/ATen/Declarations.yaml
83+
sed -i -e "s/ name: t$/ name: 't'/g" -e "s/ name: T$/ name: 'T'/g" build/aten/src/ATen/Declarations.yaml
84+
sed -i -e "s/ name: y$/ name: 'y'/g" -e "s/ name: Y$/ name: 'Y'/g" build/aten/src/ATen/Declarations.yaml
85+
sed -i -e "s/ default: \([^'].*\)$/ default: '\1'/g" build/aten/src/ATen/Declarations.yaml
86+
popd
87+
ln -fs ./pytorch/build/aten/src/ATen/Declarations.yaml
7088
- name: Install GHCup
7189
run: |
7290
mkdir -p "$HOME/.ghcup/bin"

0 commit comments

Comments
 (0)