2626 type : string
2727
2828jobs :
29- # build-wheels:
30- # strategy:
31- # fail-fast: false
32- # matrix:
33- # build: [
34- # { name: "ttmlir", path: "python" },
35- # { name: "pykernel", path: "tools/pykernel" },
36- # { name: "ttnn-jit", path: "tools/ttnn-jit" }
37- # ]
38- # name: Build ${{ matrix.build.name }} Wheel
39- # timeout-minutes: 60
40- # runs-on: ubuntu-latest
29+ build-wheels :
30+ strategy :
31+ fail-fast : false
32+ matrix :
33+ build : [
34+ { name: "ttmlir", path: "python" },
35+ { name: "pykernel", path: "tools/pykernel" }
36+ # { name: "ttnn-jit", path: "tools/ttnn-jit" } # doesn't support manylinux yet
37+ ]
38+ name : Build ${{ matrix.build.name }} Wheel
39+ timeout-minutes : 60
40+ runs-on : ubuntu-latest
4141
42- # steps:
43- # - name: Free Disk Space (Ubuntu)
44- # uses: jlumbroso/free-disk-space@main
45- # with:
46- # tool-cache: false
47- # android: true
48- # dotnet: true
49- # haskell: true
50- # large-packages: true
51- # docker-images: true
52- # swap-storage: true
42+ steps :
43+ - name : Free Disk Space (Ubuntu)
44+ uses : jlumbroso/free-disk-space@main
45+ with :
46+ tool-cache : false
47+ android : true
48+ dotnet : true
49+ haskell : true
50+ large-packages : true
51+ docker-images : true
52+ swap-storage : true
5353
54- # - uses: actions/checkout@v4
55- # with:
56- # fetch-depth: 0
54+ - uses : actions/checkout@v4
55+ with :
56+ fetch-depth : 0
5757
58- # - name: Set reusable strings
59- # id: strings
60- # shell: bash
61- # run: |
62- # echo "work-dir=$(pwd)" >> "$GITHUB_OUTPUT"
63- # echo "build-output-dir=$(pwd)/build" >> "$GITHUB_OUTPUT"
64- # echo "wheel-output-dir=$(pwd)/dist" >> "$GITHUB_OUTPUT"
58+ - name : Set reusable strings
59+ id : strings
60+ shell : bash
61+ run : |
62+ echo "work-dir=$(pwd)" >> "$GITHUB_OUTPUT"
63+ echo "build-output-dir=$(pwd)/build" >> "$GITHUB_OUTPUT"
64+ echo "wheel-output-dir=$(pwd)/dist" >> "$GITHUB_OUTPUT"
6565
66- # - name: Git safe dir
67- # run: git config --global --add safe.directory ${{ steps.strings.outputs.work-dir }}
66+ - name : Git safe dir
67+ run : git config --global --add safe.directory ${{ steps.strings.outputs.work-dir }}
6868
69- # - name: Set up Python 3.11
70- # uses: actions/setup-python@v6
71- # with:
72- # python-version: '3.11'
69+ - name : Set up Python 3.11
70+ uses : actions/setup-python@v6
71+ with :
72+ python-version : ' 3.11'
7373
74- # - name: Build ttmlir Wheel (manylinux)
75- 76- # env:
77- # CIBW_ENVIRONMENT: "IN_CIBW_ENV=ON"
78- # CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/tenstorrent/tt-mlir/tt-mlir-manylinux-2-34:${{ inputs.docker-tag || 'latest' }}
79- # with:
80- # output-dir: ${{ steps.strings.outputs.wheel-output-dir }}
81- # package-dir: ${{ steps.strings.outputs.work-dir }}/${{ matrix.build.path }}
82- # config-file: "${{ steps.strings.outputs.work-dir }}/${{ matrix.build.path }}/pyproject.toml"
74+ - name : Build ttmlir Wheel (manylinux)
75+ 76+ env :
77+ CIBW_ENVIRONMENT : " IN_CIBW_ENV=ON"
78+ CIBW_MANYLINUX_X86_64_IMAGE : ghcr.io/tenstorrent/tt-mlir/tt-mlir-manylinux-2-34:${{ inputs.docker-tag || 'latest' }}
79+ with :
80+ output-dir : ${{ steps.strings.outputs.wheel-output-dir }}
81+ package-dir : ${{ steps.strings.outputs.work-dir }}/${{ matrix.build.path }}
82+ config-file : " ${{ steps.strings.outputs.work-dir }}/${{ matrix.build.path }}/pyproject.toml"
8383
84- # - name: Upload wheel artifact
85- # uses: actions/upload-artifact@v4
86- # with:
87- # name: ${{ matrix.build.name }}-wheel
88- # path: ${{ steps.strings.outputs.wheel-output-dir }}/*.whl
89- # if-no-files-found: error
84+ - name : Upload wheel artifact
85+ uses : actions/upload-artifact@v4
86+ with :
87+ name : ${{ matrix.build.name }}-wheel
88+ path : ${{ steps.strings.outputs.wheel-output-dir }}/*.whl
89+ if-no-files-found : error
9090
9191
9292 build-ttnn-jit-wheel :
9393 timeout-minutes : 120
9494 name : Build ttnn-jit Python Wheel
9595 runs-on : ubuntu-latest
96+ container : # this should work on manylinux image
97+ image : ${{ inputs.docker_image }}
9698
9799 steps :
98100 - name : Free Disk Space (Ubuntu)
@@ -128,15 +130,11 @@ jobs:
128130
129131 - name : Build ttnn-jit Wheel
130132 run : |
131- docker run --rm \
132- -v ${{ steps.strings.outputs.work-dir }}:/workspace \
133- -w /workspace \
134- ${{ inputs.docker_image }} \
135- bash -c "
136- cd tools/ttnn-jit && \
137- pip install build setuptools wheel && \
138- python -m build --wheel --outdir /workspace/dist
139- "
133+ source env/activate
134+ cd tools/ttnn-jit
135+ pip install build setuptools wheel
136+ mkdir -p ${{ steps.strings.outputs.wheel-output-dir }}/dist
137+ python -m build --wheel --outdir ${{ steps.strings.outputs.wheel-output-dir }}/dist
140138
141139 - name : Upload wheel artifact
142140 uses : actions/upload-artifact@v4
@@ -145,74 +143,48 @@ jobs:
145143 path : ${{ steps.strings.outputs.wheel-output-dir }}/*.whl
146144 if-no-files-found : error
147145
148- # test-pykernel-wheel-install:
149- # needs: build-pykernel-wheel
150- # timeout-minutes: 30
151- # name: Test pykernel Wheel Installation
152- # runs-on: ubuntu-latest
153-
154- # steps:
155- # - uses: actions/checkout@v4
156-
157- # - name: Git safe dir
158- # run: git config --global --add safe.directory $(pwd)
159-
160- # - name: Set up Python 3.11
161- # uses: actions/setup-python@v5
162- # with:
163- # python-version: '3.11'
164-
165- # - name: Download wheel
166- # uses: actions/download-artifact@v4
167- # with:
168- # name: pykernel-wheel
169- # path: ./dist
170-
171- # - name: Test wheel installation
172- # shell: bash
173- # run: |
174- # WHEEL_FILE=$(ls ./dist/pykernel-*.whl)
175- # echo "Installing wheel: $WHEEL_FILE"
176- # pip install $WHEEL_FILE
177-
178- # # Test the ttmlir installation
179- # python -c "from ttmlir import ir; print('Imported ttmlir & Created CTX: ', ir.Context())"
180-
181- # # Test the pykernel installation
182- # python -c "import pykernel; print('Imported pykernel:', pykernel)"
146+ test-wheel-install :
147+ strategy :
148+ fail-fast : false
149+ matrix :
150+ build : [
151+ { name: "ttmlir", test: 'python -c "from ttmlir import ir; print(\"Imported ttmlir & Created CTX: \", ir.Context())"' },
152+ { name: "pykernel", test: 'python -c "import pykernel; print(\"Imported pykernel:\", pykernel)"' },
153+ # { name: "ttnn-jit", test: 'python -c "import ttnn_jit; print(\"Successfully imported ttnn_jit:\", ttnn_jit.__file__)" && python -c "import ttnn; print(\"Successfully imported ttnn:\", ttnn.__file__)"' } # doesn't support manylinux yet
154+ ]
155+
156+ needs : build-wheels
157+ timeout-minutes : 30
158+ name : Test pykernel Wheel Installation
159+ runs-on : ubuntu-latest
183160
184- # test-ttmlir-wheel-install:
185- # needs: build-ttmlir-wheel
186- # timeout-minutes: 30
187- # name: Test ttmlir Wheel Installation
188- # runs-on: ubuntu-latest
161+ steps :
162+ - uses : actions/checkout@v4
189163
190- # steps:
191- # - uses: actions/checkout@v4
164+ - name : Git safe dir
165+ run : git config --global --add safe.directory $(pwd)
192166
193- # - name: Git safe dir
194- # run: git config --global --add safe.directory $(pwd)
167+ - name : Set up Python 3.11
168+ uses : actions/setup-python@v6
169+ with :
170+ python-version : ' 3.11'
195171
196- # - name: Set up Python 3.11
197- # uses: actions/setup-python@v5
198- # with:
199- # python-version: '3.11'
172+ - name : Download wheel
173+ uses : actions/download-artifact@v4
174+ with :
175+ name : ${{ matrix.build.name }}-wheel
176+ path : ./dist
200177
201- # - name: Download wheel
202- # uses: actions/download-artifact@v4
203- # with:
204- # name: ttmlir-wheel
205- # path: ./dist
178+ - name : Test wheel installation
179+ shell : bash
180+ run : |
181+ WHEEL_FILE=$(ls ./dist/${{ matrix.build.name }}-*.whl)
182+ echo "Installing wheel: $WHEEL_FILE"
183+ pip install $WHEEL_FILE
206184
207- # - name: Test wheel installation
208- # shell: bash
209- # run: |
210- # WHEEL_FILE=$(ls ./dist/ttmlir-*.whl)
211- # echo "Installing wheel: $WHEEL_FILE"
212- # pip install $WHEEL_FILE
185+ # Test the installation
186+ ${{ matrix.build.test }}
213187
214- # # Test the installation
215- # python -c "from ttmlir import ir; print('Imported ttmlir & Created CTX: ', ir.Context())"
216188
217189 test-ttnn-jit :
218190 timeout-minutes : 45
0 commit comments