Skip to content

Commit 7be739f

Browse files
authored
Merge pull request #2245 from IntelPython/feature/uncouple-tensor-from-dpctl
Remove deprecated `dpctl.tensor` submodule
2 parents e4d3a3d + e4b1415 commit 7be739f

582 files changed

Lines changed: 638 additions & 134366 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.flake8

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,7 @@ per-file-ignores =
2323
dpctl/_sycl_queue_manager.pyx: E999, E225
2424
dpctl/memory/_memory.pyx: E999, E225, E226, E227
2525
dpctl/program/_program.pyx: E999, E225, E226, E227
26-
dpctl/tensor/_usmarray.pyx: E999, E225, E226, E227
27-
dpctl/tensor/_dlpack.pyx: E999, E225, E226, E227
28-
dpctl/tensor/_flags.pyx: E999, E225, E226, E227
29-
dpctl/tensor/numpy_usm_shared.py: F821
3026
dpctl/tests/_cython_api.pyx: E999, E225, E227, E402
31-
dpctl/utils/_compute_follows_data.pyx: E999, E225, E227
3227
dpctl/utils/_onetrace_context.py: E501, W505
33-
dpctl/tensor/_array_api.py: E501, W505
3428
examples/cython/sycl_buffer/syclbuffer/_syclbuffer.pyx: E999, E225, E402
35-
examples/cython/usm_memory/blackscholes/_blackscholes_usm.pyx: E999, E225, E226, E402
3629
examples/cython/use_dpctl_sycl/use_dpctl_sycl/_cython_api.pyx: E999, E225, E226, E402

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

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/conda-package.yml

Lines changed: 0 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -665,154 +665,6 @@ jobs:
665665
python ${script} || exit 1
666666
done
667667
668-
array-api-conformity:
669-
needs: build_linux
670-
runs-on: ${{ matrix.runner }}
671-
timeout-minutes: 90
672-
permissions:
673-
pull-requests: write
674-
675-
strategy:
676-
matrix:
677-
python: ['3.10']
678-
experimental: [false]
679-
runner: [ubuntu-22.04]
680-
continue-on-error: ${{ matrix.experimental }}
681-
steps:
682-
- name: Construct channels line
683-
run: |
684-
echo "CHANNELS=-c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels" >> $GITHUB_ENV
685-
- name: Display channels line
686-
run: |
687-
echo ${{ env.CHANNELS }}
688-
- name: Checkout dpctl repo
689-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
690-
with:
691-
fetch-depth: 0
692-
- name: Cache array API tests
693-
id: cache-array-api-tests
694-
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
695-
env:
696-
ARRAY_CACHE: 3
697-
with:
698-
path: |
699-
/home/runner/work/array-api-tests/
700-
key: ${{ runner.os }}-array-api-${{ env.cache-name }}-{{ env.ARRAY_CACHE }}-${{ hashFiles('/home/runner/work/array-api-tests/requirements.txt') }}
701-
restore-keys: |
702-
${{ runner.os }}-build-${{ env.cache-name }}-
703-
${{ runner.os }}-build-
704-
${{ runner.os }}-
705-
- name: Clone array API tests repo
706-
if: steps.cache-array-api-tests.outputs.cache-hit != 'true'
707-
shell: bash -l {0}
708-
run: |
709-
cd /home/runner/work
710-
git clone --recurse-submodules https://github.com/data-apis/array-api-tests array-api-tests
711-
cd array-api-tests
712-
- name: Download artifact
713-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
714-
with:
715-
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
716-
- name: Add conda to system path
717-
run: echo $CONDA/bin >> $GITHUB_PATH
718-
- name: Install conda-index
719-
# Needed to be able to run conda index
720-
run: |
721-
conda update -n base --all
722-
conda install conda-index -c conda-forge --override-channels
723-
- name: Create conda channel
724-
run: |
725-
mkdir -p $GITHUB_WORKSPACE/channel/linux-64
726-
conda index $GITHUB_WORKSPACE/channel || exit 1
727-
mv ${PACKAGE_NAME}-*.conda $GITHUB_WORKSPACE/channel/linux-64 || exit 1
728-
conda index $GITHUB_WORKSPACE/channel || exit 1
729-
# Test channel
730-
conda search $PACKAGE_NAME -c $GITHUB_WORKSPACE/channel --override-channels --info --json > $GITHUB_WORKSPACE/ver.json
731-
cat ver.json
732-
- name: Collect dependencies
733-
run: |
734-
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
735-
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
736-
conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME=${PACKAGE_VERSION} python=${{ matrix.python }} $CHANNELS --only-deps --dry-run > lockfile
737-
cat lockfile
738-
- name: Set pkgs_dirs
739-
run: |
740-
echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc
741-
- name: Cache conda packages
742-
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
743-
env:
744-
CACHE_NUMBER: 3 # Increase to reset cache
745-
with:
746-
path: ~/.conda/pkgs
747-
key:
748-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('lockfile') }}
749-
restore-keys: |
750-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
751-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
752-
- name: Install dpctl
753-
run: |
754-
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
755-
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
756-
conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME=${PACKAGE_VERSION} pytest python=${{ matrix.python }} $CHANNELS
757-
# Test installed packages
758-
conda list
759-
- name: Install array API test dependencies
760-
shell: bash -l {0}
761-
run: |
762-
. $CONDA/etc/profile.d/conda.sh
763-
conda activate ${{ env.TEST_ENV_NAME }}
764-
cd /home/runner/work/array-api-tests
765-
pip install -r requirements.txt
766-
- name: Install jq
767-
shell: bash -l {0}
768-
run: |
769-
sudo apt-get install jq
770-
- name: Run array API conformance tests
771-
id: run-array-api-tests
772-
shell: bash -l {0}
773-
env:
774-
ARRAY_API_TESTS_MODULE: 'dpctl.tensor'
775-
ARRAY_API_TESTS_VERSION: '2024.12'
776-
SYCL_CACHE_PERSISTENT: 1
777-
run: |
778-
FILE=/home/runner/work/.report.json
779-
. $CONDA/etc/profile.d/conda.sh
780-
conda activate ${{ env.TEST_ENV_NAME }}
781-
cd /home/runner/work/array-api-tests
782-
${CONDA_PREFIX}/bin/python -c "import dpctl; dpctl.lsplatform()"
783-
${CONDA_PREFIX}/bin/python -m pytest --json-report --json-report-file=$FILE --disable-deadline --skips-file ${GITHUB_WORKSPACE}/.github/workflows/array-api-skips.txt array_api_tests/ || true
784-
- name: Set Github environment variables
785-
shell: bash -l {0}
786-
run: |
787-
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
788-
FILE=/home/runner/work/.report.json
789-
if test -f "$FILE"; then
790-
PASSED_TESTS=$(jq '.summary | .passed // 0' $FILE)
791-
FAILED_TESTS=$(jq '.summary | .failed // 0' $FILE)
792-
SKIPPED_TESTS=$(jq '.summary | .skipped // 0' $FILE)
793-
MESSAGE="Array API standard conformance tests for dpctl=$PACKAGE_VERSION ran successfully.
794-
Passed: $PASSED_TESTS
795-
Failed: $FAILED_TESTS
796-
Skipped: $SKIPPED_TESTS"
797-
echo "MESSAGE<<EOF" >> $GITHUB_ENV
798-
echo "$MESSAGE" >> $GITHUB_ENV
799-
echo "EOF" >> $GITHUB_ENV
800-
else
801-
echo "Array API standard conformance tests failed to run for dpctl=$PACKAGE_VERSION."
802-
exit 1
803-
fi
804-
- name: Output API summary
805-
shell: bash -l {0}
806-
run: echo "::notice ${{ env.MESSAGE }}"
807-
- name: Post result to PR
808-
if: ${{ github.event.pull_request && !github.event.pull_request.head.repo.fork }}
809-
uses: mshick/add-pr-comment@64b8e914979889d746c99dea15a76e77ef64580a # v3.10.0.8.3.10.0
810-
with:
811-
message: |
812-
${{ env.MESSAGE }}
813-
allow-repeats: true
814-
repo-token: ${{ secrets.GITHUB_TOKEN }}
815-
816668
cleanup_packages:
817669
name: Clean up anaconda packages
818670
needs: [upload_linux, upload_windows]

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ dpctl/_sycl_event.h
9898
dpctl/_sycl_queue.h
9999
dpctl/_sycl_queue_manager.h
100100
dpctl/memory/_memory.h
101-
dpctl/tensor/_usmarray.h
102101

103102
# moved cmake scripts
104103
dpctl/resources/cmake

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [dev] - XXX. XX, XXXX
88

9+
### Removed
10+
11+
* Removed previously deprecated `dpctl.tensor` submodule, with all tensor functionality migrated to [`dpnp`](https://github.com/IntelPython/dpnp) [gh-2245](https://github.com/IntelPython/dpctl/pull/2245)
12+
* Removed `cython/usm_memory` example which couldn't be reasonably rewritten without `dpctl.tensor` [gh-2245](https://github.com/IntelPython/dpctl/pull/2245)
13+
914
### Added
1015

1116
### Changed
@@ -18,6 +23,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1823

1924
* Enabled multiversion documentation for `dpctl` using a custom drop-down for version selection and a `--multiversion` option for documentation build helper script [gh-2276](https://github.com/IntelPython/dpctl/pull/2276)
2025

26+
* Updated examples to remove use of `dpctl.tensor`, opting to simplify the examples and rely on `dpctl.memory` objects which wrap USM allocations [gh-2245](https://github.com/IntelPython/dpctl/pull/2245)
27+
2128
## [0.21.1] - Nov. 29, 2025
2229

2330
This release is made to distribute `dpctl` for Python 3.14. Only the non-free-threaded version of Python is supported as of this release.

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@ classes](https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.ht
2929

3030
`dpctl` features classes for [SYCL Unified Shared Memory
3131
(USM)](https://link.springer.com/chapter/10.1007/978-1-4842-5574-2_6)
32-
management and implements a tensor library conforming to [Python Array
33-
API](https://data-apis.org/array-api/latest/) standard.
32+
management.
3433

3534
The library helps authors of Python native extensions written
3635
in C, Cython, or pybind11 to access `dpctl` objects representing SYCL
37-
devices, queues, memory, and tensors.
36+
devices, queues, and memory.
3837

3938
`Dpctl` is the core part of a larger family of [data-parallel Python
4039
libraries and tools](https://www.intel.com/content/www/us/en/developer/tools/oneapi/distribution-for-python.html)

benchmarks/README.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

benchmarks/asv.conf.json

Lines changed: 0 additions & 53 deletions
This file was deleted.

benchmarks/benchmarks/__init__.py

Whitespace-only changes.

benchmarks/benchmarks/benchmark_utils.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)