@@ -17,61 +17,14 @@ jobs:
1717 - name : Checkout repository
1818 uses : actions/checkout@v3
1919
20- - name : Set up Python
21- uses : actions/setup-python@v4
22- with :
23- python-version : 3.9 # Adjust if a different Python version is needed
20+ - name : Set up Docker Buildx
21+ uses : docker/setup-buildx-action@v2
2422
25- - name : Install dependencies
23+ - name : Build Docker image for ppc64le
2624 run : |
27- # Install EPEL release
28- sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
29-
30- # Install development tools and libraries
31- sudo dnf install -y git cmake ninja-build g++ rust cargo \
32- python3.9-devel python3.9-wheel python3.9-pip python3.9-setuptools
33-
34- # Ensure Python and pip are accessible by symlinking
35- if ! command -v python; then
36- sudo ln -s $(command -v python3.9) /usr/bin/python
37- fi
38- if ! command -v pip; then
39- sudo ln -s $(command -v pip3.9) /usr/bin/pip
40- fi
25+ docker build -f .github/workflows/Dockerfile.ppc64le -t pytorch-ppc64le:ubi9.3 .
4126
42- - name : Clone and Checkout
27+ - name : Run Docker container and execute build script
4328 run : |
44- # Clone the repository and check out the specified version
45- git clone https://github.com/pytorch/pytorch.git
46- cd pytorch
47- git checkout tags/v2.4.0
48-
49- - name : Apply POWER Patch
50- run : |
51- cd pytorch
52- PPC64LE_PATCH="69cbf05"
53- if ! git log --pretty=format:"%H" | grep -q "$PPC64LE_PATCH"; then
54- echo "Applying POWER patch."
55- git config user.email "[email protected] " 56- git config user.name "Md. Shafi Hussain"
57- git cherry-pick "$PPC64LE_PATCH"
58- else
59- echo "POWER patch not needed."
60- fi
61-
62- - name : Update submodules
63- run : |
64- cd pytorch
65- git submodule sync
66- git submodule update --init --recursive
67-
68- - name : Install Python dependencies
69- run : |
70- cd pytorch
71- pip install -r requirements.txt
72-
73- - name : Build PyTorch wheel
74- run : |
75- cd pytorch
76- MAX_JOBS=$(nproc) python setup.py bdist_wheel
77- pip install dist/*.whl
29+ docker run --rm pytorch-ppc64le:ubi9.3 /workspace/.github/scripts/ppc64le-build.sh
30+
0 commit comments