Skip to content

Commit a8c35b9

Browse files
authored
Merge e3ebbc7 into 3d02b6b
2 parents 3d02b6b + e3ebbc7 commit a8c35b9

File tree

2 files changed

+246
-2
lines changed

2 files changed

+246
-2
lines changed

.github/workflows/array-api-skips.txt

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# array API tests to be skipped
2+
3+
# no 'uint8' dtype
4+
array_api_tests/test_array_object.py::test_getitem_masking
5+
6+
# no 'isdtype' function
7+
array_api_tests/test_data_type_functions.py::test_isdtype
8+
array_api_tests/test_has_names.py::test_has_names[data_type-isdtype]
9+
array_api_tests/test_signatures.py::test_func_signature[isdtype]
10+
11+
# missing unique-like functions
12+
array_api_tests/test_has_names.py::test_has_names[set-unique_all]
13+
array_api_tests/test_has_names.py::test_has_names[set-unique_counts]
14+
array_api_tests/test_has_names.py::test_has_names[set-unique_inverse]
15+
array_api_tests/test_has_names.py::test_has_names[set-unique_values]
16+
array_api_tests/test_set_functions.py::test_unique_all
17+
array_api_tests/test_set_functions.py::test_unique_counts
18+
array_api_tests/test_set_functions.py::test_unique_invers
19+
array_api_tests/test_set_functions.py::test_unique_values
20+
array_api_tests/test_signatures.py::test_func_signature[unique_all]
21+
array_api_tests/test_signatures.py::test_func_signature[unique_counts]
22+
array_api_tests/test_signatures.py::test_func_signature[unique_inverse]
23+
array_api_tests/test_signatures.py::test_func_signature[unique_values]
24+
25+
# no '__array_namespace_info__' function
26+
array_api_tests/test_has_names.py::test_has_names[info-__array_namespace_info__]
27+
array_api_tests/test_inspection_functions.py::test_array_namespace_info
28+
array_api_tests/test_inspection_functions.py::test_array_namespace_info_dtypes
29+
array_api_tests/test_searching_functions.py::test_searchsorted
30+
array_api_tests/test_signatures.py::test_func_signature[__array_namespace_info__]
31+
array_api_tests/test_signatures.py::test_info_func_signature[capabilities]
32+
array_api_tests/test_signatures.py::test_info_func_signature[default_device]
33+
array_api_tests/test_signatures.py::test_info_func_signature[default_dtypes]
34+
array_api_tests/test_signatures.py::test_info_func_signature[devices]
35+
array_api_tests/test_signatures.py::test_info_func_signature[dtypes]
36+
37+
# do not return a namedtuple
38+
array_api_tests/test_linalg.py::test_eigh
39+
array_api_tests/test_linalg.py::test_slogdet
40+
array_api_tests/test_linalg.py::test_svd
41+
42+
# hypothesis found failures
43+
array_api_tests/test_linalg.py::test_qr
44+
array_api_tests/test_operators_and_elementwise_functions.py::test_clip
45+
46+
# unexpected result is returned
47+
array_api_tests/test_operators_and_elementwise_functions.py::test_asin
48+
49+
# missing 'descending' keyword argument
50+
array_api_tests/test_signatures.py::test_func_signature[argsort]
51+
array_api_tests/test_signatures.py::test_func_signature[sort]
52+
array_api_tests/test_sorting_functions.py::test_argsort
53+
array_api_tests/test_sorting_functions.py::test_sort
54+
55+
# missing 'correction' keyword argument
56+
array_api_tests/test_signatures.py::test_func_signature[std]
57+
array_api_tests/test_signatures.py::test_func_signature[var]
58+
59+
# missing 'stream' keyword argument
60+
array_api_tests/test_signatures.py::test_array_method_signature[to_device]

.github/workflows/conda-package.yml

Lines changed: 186 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ jobs:
191191

192192
- name: Smoke test
193193
run: |
194-
python -c "import dpnp, dpctl; dpctl.lsplatform()"
194+
python -c "import dpctl; dpctl.lsplatform()"
195195
python -c "import dpnp; print(dpnp.__version__)"
196196
197197
- name: Run tests
@@ -332,7 +332,7 @@ jobs:
332332
333333
- name: Smoke test
334334
run: |
335-
python -c "import dpnp, dpctl; dpctl.lsplatform()"
335+
python -c "import dpctl; dpctl.lsplatform()"
336336
python -c "import dpnp; print(dpnp.__version__)"
337337
338338
- name: Run tests
@@ -414,6 +414,190 @@ jobs:
414414
env:
415415
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
416416

417+
array-api-conformity:
418+
name: Array API conformity
419+
420+
needs: build
421+
422+
permissions:
423+
# Needed to add a comment to a pull request's issue
424+
pull-requests: write
425+
426+
strategy:
427+
matrix:
428+
python: ['3.12']
429+
os: [ubuntu-22.04]
430+
431+
runs-on: ${{ matrix.os }}
432+
433+
defaults:
434+
run:
435+
shell: bash -el {0}
436+
437+
continue-on-error: true
438+
439+
env:
440+
array-api-tests-path: '${{ github.workspace }}/array-api-tests/'
441+
json-report-file: '${{ github.workspace }}/.report.json'
442+
dpnp-repo-path: '${{ github.workspace }}/dpnp/'
443+
array-api-skips-file: '${{ github.workspace }}/dpnp/.github/workflows/array-api-skips.txt'
444+
channel-path: '${{ github.workspace }}/channel/'
445+
pkg-path-in-channel: '${{ github.workspace }}/channel/linux-64/'
446+
extracted-pkg-path: '${{ github.workspace }}/pkg/'
447+
ver-json-path: '${{ github.workspace }}/version.json'
448+
449+
steps:
450+
- name: Download artifact
451+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
452+
with:
453+
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
454+
path: ${{ env.pkg-path-in-channel }}
455+
456+
- name: Extract package archive
457+
run: |
458+
mkdir -p ${{ env.extracted-pkg-path }}
459+
tar -xvf ${{ env.pkg-path-in-channel }}/${{ env.PACKAGE_NAME }}-*.tar.bz2 -C ${{ env.extracted-pkg-path }}
460+
461+
- name: Setup miniconda
462+
id: setup_miniconda
463+
continue-on-error: true
464+
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
465+
with:
466+
miniforge-version: latest
467+
use-mamba: 'true'
468+
channels: conda-forge
469+
conda-remove-defaults: 'true'
470+
python-version: ${{ matrix.python }}
471+
activate-environment: 'array-api-conformity'
472+
473+
- name: ReSetup miniconda
474+
if: steps.setup_miniconda.outcome == 'failure'
475+
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
476+
with:
477+
miniforge-version: latest
478+
use-mamba: 'true'
479+
channels: conda-forge
480+
conda-remove-defaults: 'true'
481+
python-version: ${{ matrix.python }}
482+
activate-environment: 'array-api-conformity'
483+
484+
- name: Install conda-index
485+
id: install_conda_index
486+
continue-on-error: true
487+
run: mamba install conda-index=${{ env.CONDA_INDEX_VERSION }}
488+
489+
- name: ReInstall conda-index
490+
if: steps.install_conda_index.outcome == 'failure'
491+
run: mamba install conda-index=${{ env.CONDA_INDEX_VERSION }}
492+
493+
- name: Create conda channel
494+
run: |
495+
python -m conda_index ${{ env.channel-path }}
496+
497+
- name: Test conda channel
498+
run: |
499+
conda search ${{ env.PACKAGE_NAME }} -c ${{ env.channel-path }} --override-channels --info --json > ${{ env.ver-json-path }}
500+
cat ${{ env.ver-json-path }}
501+
502+
- name: Get package version
503+
run: |
504+
export PACKAGE_VERSION=$(python -c "${{ env.VER_SCRIPT1 }} ${{ env.VER_SCRIPT2 }}")
505+
506+
echo PACKAGE_VERSION=${PACKAGE_VERSION}
507+
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
508+
509+
- name: Install dpnp
510+
id: install_dpnp
511+
continue-on-error: true
512+
run: |
513+
mamba install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} pytest python=${{ matrix.python }} ${{ env.TEST_CHANNELS }}
514+
env:
515+
TEST_CHANNELS: '-c ${{ env.channel-path }} ${{ env.CHANNELS }}'
516+
517+
- name: ReInstall dpnp
518+
if: steps.install_dpnp.outcome == 'failure'
519+
run: |
520+
mamba install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} pytest python=${{ matrix.python }} ${{ env.TEST_CHANNELS }}
521+
env:
522+
TEST_CHANNELS: '-c ${{ env.channel-path }} ${{ env.CHANNELS }}'
523+
524+
- name: List installed packages
525+
run: mamba list
526+
527+
- name: Smoke test
528+
run: |
529+
python -c "import dpctl; dpctl.lsplatform()"
530+
python -c "import dpnp; print(dpnp.__version__)"
531+
532+
- name: Clone array API tests repo
533+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
534+
with:
535+
repository: 'data-apis/array-api-tests'
536+
path: ${{ env.array-api-tests-path }}
537+
fetch-depth: 0
538+
submodules: 'recursive'
539+
540+
- name: Install array API test dependencies
541+
run: |
542+
pip install -r requirements.txt
543+
working-directory: ${{ env.array-api-tests-path }}
544+
545+
- name: Install jq
546+
run: |
547+
sudo apt-get install jq
548+
549+
- name: List installed packages
550+
run: mamba list
551+
552+
- name: Smoke test
553+
run: |
554+
python -c "import dpctl; dpctl.lsplatform()"
555+
python -c "import dpnp; print(dpnp.__version__)"
556+
557+
# need to fetch array-api-skips.txt
558+
- name: Checkout DPNP repo
559+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
560+
with:
561+
path: ${{ env.dpnp-repo-path }}
562+
563+
- name: Run array API conformance tests
564+
run: |
565+
python -m pytest --json-report --json-report-file=${{ env.json-report-file }} --disable-deadline --skips-file ${{ env.array-api-skips-file }} array_api_tests || true
566+
env:
567+
ARRAY_API_TESTS_MODULE: 'dpnp'
568+
SYCL_CACHE_PERSISTENT: 1
569+
working-directory: ${{ env.array-api-tests-path }}
570+
571+
- name: Set Github environment variables
572+
run: |
573+
FILE=${{ env.json-report-file }}
574+
if test -f "$FILE"; then
575+
PASSED_TESTS=$(jq '.summary | .passed // 0' $FILE)
576+
FAILED_TESTS=$(jq '.summary | .failed // 0' $FILE)
577+
SKIPPED_TESTS=$(jq '.summary | .skipped // 0' $FILE)
578+
MESSAGE="Array API standard conformance tests for dpnp=$PACKAGE_VERSION ran successfully.
579+
Passed: $PASSED_TESTS
580+
Failed: $FAILED_TESTS
581+
Skipped: $SKIPPED_TESTS"
582+
echo "MESSAGE<<EOF" >> $GITHUB_ENV
583+
echo "$MESSAGE" >> $GITHUB_ENV
584+
echo "EOF" >> $GITHUB_ENV
585+
else
586+
echo "Array API standard conformance tests failed to run for dpnp=$PACKAGE_VERSION."
587+
exit 1
588+
fi
589+
590+
- name: Output API summary
591+
run: echo "::notice ${{ env.MESSAGE }}"
592+
593+
- name: Post result to PR
594+
if: ${{ github.event.pull_request && !github.event.pull_request.head.repo.fork }}
595+
uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2.8.2
596+
with:
597+
message: |
598+
${{ env.MESSAGE }}
599+
allow-repeats: false
600+
417601
cleanup_packages:
418602
name: Clean up anaconda packages
419603

0 commit comments

Comments
 (0)