1- name : CI
1+ name : ROCm CPU CI
22
33# We test all supported Python versions as follows:
44# - 3.10 : Documentation build
1111 # but only for the main branch
1212 push :
1313 branches :
14- - main
14+ - rocm- main
1515 pull_request :
1616 branches :
17- - main
17+ - rocm- main
1818
1919permissions :
2020 contents : read # to fetch code
@@ -29,18 +29,21 @@ jobs:
2929 runs-on : ubuntu-latest
3030 timeout-minutes : 5
3131 steps :
32- - uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
32+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3333 - name : Set up Python 3.11
34- uses : actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2 .0
34+ uses : actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3 .0
3535 with :
3636 python-version : 3.11
37- - uses : pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
37+ - run : python -m pip install pre-commit
38+ - uses : actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
39+ with :
40+ path : ~/.cache/pre-commit
41+ key : pre-commit-${{ env.pythonLocation }}-${{ hashFiles('.pre-commit-config.yaml', 'setup.py') }}
42+ - run : pre-commit run --show-diff-on-failure --color=always --all-files
3843
3944 build :
4045 name : " build ${{ matrix.name-prefix }} (py ${{ matrix.python-version }} on ubuntu-20.04, x64=${{ matrix.enable-x64}})"
41- runs-on : linux-x86-n2-32
42- container :
43- image : index.docker.io/library/ubuntu@sha256:6d8d9799fe6ab3221965efac00b4c34a2bcc102c086a58dff9e19a08b913c7ef # ratchet:ubuntu:20.04
46+ runs-on : ROCM-Ubuntu
4447 timeout-minutes : 60
4548 strategy :
4649 matrix :
5760 prng-upgrade : 0
5861 num_generated_cases : 1
5962 steps :
60- - uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
61- - name : Image Setup
62- run : |
63- apt update
64- apt install -y libssl-dev
63+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6564 - name : Set up Python ${{ matrix.python-version }}
66- uses : actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2 .0
65+ uses : actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3 .0
6766 with :
6867 python-version : ${{ matrix.python-version }}
6968 - name : Get pip cache dir
7271 python -m pip install --upgrade pip wheel
7372 echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
7473 - name : pip cache
75- uses : actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
74+ uses : actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
7675 with :
7776 path : ${{ steps.pip-cache.outputs.dir }}
7877 key : ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('**/setup.py', '**/requirements.txt', '**/test-requirements.txt') }}
@@ -102,15 +101,15 @@ jobs:
102101
103102 documentation :
104103 name : Documentation - test code snippets
105- runs-on : ubuntu-latest
104+ runs-on : ROCM-Ubuntu
106105 timeout-minutes : 10
107106 strategy :
108107 matrix :
109108 python-version : ['3.10']
110109 steps :
111- - uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
110+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
112111 - name : Set up Python ${{ matrix.python-version }}
113- uses : actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2 .0
112+ uses : actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3 .0
114113 with :
115114 python-version : ${{ matrix.python-version }}
116115 - name : Get pip cache dir
@@ -119,7 +118,7 @@ jobs:
119118 python -m pip install --upgrade pip wheel
120119 echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
121120 - name : pip cache
122- uses : actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
121+ uses : actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
123122 with :
124123 path : ${{ steps.pip-cache.outputs.dir }}
125124 key : ${{ runner.os }}-pip-docs-${{ hashFiles('**/setup.py', '**/requirements.txt', '**/test-requirements.txt') }}
@@ -140,14 +139,14 @@ jobs:
140139 documentation_render :
141140 name : Documentation - render documentation
142141 runs-on : ubuntu-latest
143- timeout-minutes : 10
142+ timeout-minutes : 20
144143 strategy :
145144 matrix :
146145 python-version : ['3.10']
147146 steps :
148- - uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
147+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
149148 - name : Set up Python ${{ matrix.python-version }}
150- uses : actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2 .0
149+ uses : actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3 .0
151150 with :
152151 python-version : ${{ matrix.python-version }}
153152 - name : Get pip cache dir
@@ -156,7 +155,7 @@ jobs:
156155 python -m pip install --upgrade pip wheel
157156 echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
158157 - name : pip cache
159- uses : actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
158+ uses : actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
160159 with :
161160 path : ${{ steps.pip-cache.outputs.dir }}
162161 key : ${{ runner.os }}-pip-docs-${{ hashFiles('**/setup.py', '**/requirements.txt', '**/test-requirements.txt') }}
@@ -165,8 +164,7 @@ jobs:
165164 pip install -r docs/requirements.txt
166165 - name : Render documentation
167166 run : |
168- sphinx-build --color -W --keep-going -b html -D nb_execution_mode=off docs docs/build/html
169-
167+ sphinx-build -j auto --color -W --keep-going -b html -D nb_execution_mode=off docs docs/build/html
170168
171169 jax2tf_test :
172170 name : " jax2tf_test (py ${{ matrix.python-version }} on ${{ matrix.os }}, x64=${{ matrix.enable-x64}})"
@@ -181,9 +179,9 @@ jobs:
181179 enable-x64 : 0
182180 num_generated_cases : 10
183181 steps :
184- - uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
182+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
185183 - name : Set up Python ${{ matrix.python-version }}
186- uses : actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2 .0
184+ uses : actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3 .0
187185 with :
188186 python-version : ${{ matrix.python-version }}
189187 - name : Get pip cache dir
@@ -192,7 +190,7 @@ jobs:
192190 python -m pip install --upgrade pip wheel
193191 echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
194192 - name : pip cache
195- uses : actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
193+ uses : actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
196194 with :
197195 path : ${{ steps.pip-cache.outputs.dir }}
198196 key : ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('**/setup.py', '**/requirements.txt', '**/test-requirements.txt') }}
@@ -217,21 +215,21 @@ jobs:
217215
218216 ffi :
219217 name : FFI example
220- runs-on : ubuntu-latest
221- timeout-minutes : 5
218+ runs-on : ROCM-Ubuntu
219+ timeout-minutes : 30
222220 steps :
223- - uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
224- - name : Set up Python 3.11
225- uses : actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2 .0
221+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
222+ - name : Set up Python
223+ uses : actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3 .0
226224 with :
227- python-version : 3.11
225+ python-version : 3.12
228226 - name : Get pip cache dir
229227 id : pip-cache
230228 run : |
231229 python -m pip install --upgrade pip wheel
232230 echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
233231 - name : pip cache
234- uses : actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
232+ uses : actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
235233 with :
236234 path : ${{ steps.pip-cache.outputs.dir }}
237235 key : ${{ runner.os }}-pip-ffi-examples-${{ hashFiles('**/setup.py', '**/requirements.txt', '**/test-requirements.txt', 'examples/**/pyproject.toml') }}
@@ -245,6 +243,10 @@ jobs:
245243 # a different toolchain. GCC is the default compiler on the
246244 # 'ubuntu-latest' runner, but we still set this explicitly just to be
247245 # clear.
248- CMAKE_ARGS : -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
249- - name : Run tests
246+ CMAKE_ARGS : -DCMAKE_CXX_COMPILER=g++ # -DJAX_FFI_EXAMPLE_ENABLE_CUDA=ON
247+ - name : Run CPU tests
248+ run : python -m pytest examples/ffi/tests
249+ env :
250+ JAX_PLATFORM_NAME : cpu
251+ - name : Run GPU tests
250252 run : python -m pytest examples/ffi/tests
0 commit comments