Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 85 additions & 31 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ jobs:
strategy:
matrix:
python: ['3.10', '3.11', '3.12', '3.13', '3.14']
python_spec: ['']
include:
- python: '3.14'
python_spec: '3.14.* *_cp314'
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@3155a141048f8f89c06b4cdae32e7853e97536bc # 0.13.0
Expand All @@ -45,9 +49,9 @@ jobs:
with:
path: ~/.conda/pkgs
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('**/meta.yaml') }}
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-spec-${{ matrix.python == '3.14' && matrix.python_spec == '' && 't' || '' }}-${{hashFiles('**/meta.yaml') }}
restore-keys: |
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-spec-${{ matrix.python == '3.14' && matrix.python_spec == '' && 't' || '' }}-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
- name: Add conda to system path
run: echo $CONDA/bin >> $GITHUB_PATH
Expand All @@ -61,22 +65,31 @@ jobs:
run: |
# use bootstrap channel to pull NumPy linked with OpenBLAS
CHANNELS="-c conda-forge --override-channels"
VERSIONS="--python ${{ matrix.python }} --numpy 2.0"
TEST="--no-test"
conda build \
$TEST \
$VERSIONS \
$CHANNELS \
conda-recipe
if [ -n "${{ matrix.python_spec }}" ]; then
conda build \
$TEST \
--python "${{ matrix.python_spec }}" \
--numpy 2.0 \
$CHANNELS \
conda-recipe
else
conda build \
$TEST \
--python ${{ matrix.python }} \
--numpy 2.0 \
$CHANNELS \
conda-recipe
fi
- name: Upload artifact
uses: actions/[email protected]
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python == '3.14' && (matrix.python_spec != '' && '3.14' || '3.14t') || matrix.python }}
path: /usr/share/miniconda/conda-bld/linux-64/${{ env.PACKAGE_NAME }}-*.conda
- name: Upload wheels artifact
uses: actions/[email protected]
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python }}
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python == '3.14' && (matrix.python_spec != '' && '3.14' || '3.14t') || matrix.python }}
path: ${{ env.WHEELS_OUTPUT_FOLDER }}${{ env.PACKAGE_NAME }}-*.whl

build_windows:
Expand All @@ -86,6 +99,10 @@ jobs:
strategy:
matrix:
python: ['3.10', '3.11', '3.12', '3.13', '3.14']
python_spec: ['']
include:
- python: '3.14'
python_spec: '3.14.* *_cp314'
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@3155a141048f8f89c06b4cdae32e7853e97536bc # 0.13.0
Expand Down Expand Up @@ -118,9 +135,9 @@ jobs:
with:
path: /home/runner/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('**/meta.yaml') }}
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-spec-${{ matrix.python == '3.14' && matrix.python_spec == '' && 't' || '' }}-${{hashFiles('**/meta.yaml') }}
restore-keys: |
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-spec-${{ matrix.python == '3.14' && matrix.python_spec == '' && 't' || '' }}-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-

- name: Store conda paths as envs
Expand All @@ -135,18 +152,23 @@ jobs:
run: |
conda activate
# TODO: roll back use of Intel channel when 2025.1 is available on conda-forge
conda build --no-test --python ${{ matrix.python }} --numpy 2.0 -c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels conda-recipe
$PYTHON_SPEC = "${{ matrix.python_spec }}"
if ($PYTHON_SPEC -ne "") {
conda build --no-test --python "$PYTHON_SPEC" --numpy 2.0 -c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels conda-recipe
} else {
conda build --no-test --python ${{ matrix.python }} --numpy 2.0 -c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels conda-recipe
}

- name: Upload artifact
uses: actions/[email protected]
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python == '3.14' && (matrix.python_spec != '' && '3.14' || '3.14t') || matrix.python }}
path: ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.conda

- name: Upload wheels artifact
uses: actions/[email protected]
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python }}
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python == '3.14' && (matrix.python_spec != '' && '3.14' || '3.14t') || matrix.python }}
path: ${{ env.WHEELS_OUTPUT_FOLDER }}${{ env.PACKAGE_NAME }}-*.whl

test_linux:
Expand All @@ -157,6 +179,12 @@ jobs:
strategy:
matrix:
python: ['3.10', '3.11', '3.12', '3.13', '3.14']
python_spec: ['']
include:
- python: '3.14'
python_spec: '3.14.* *_cp314'
experimental: false
runner: ubuntu-22.04
experimental: [false]
runner: [ubuntu-22.04]
continue-on-error: ${{ matrix.experimental }}
Expand All @@ -171,7 +199,7 @@ jobs:
- name: Download artifact
uses: actions/download-artifact@v7
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python == '3.14' && (matrix.python_spec != '' && '3.14' || '3.14t') || matrix.python }}
- name: Add conda to system path
run: echo $CONDA/bin >> $GITHUB_PATH
- name: Install conda-index
Expand All @@ -192,7 +220,11 @@ jobs:
run: |
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME=${PACKAGE_VERSION} python=${{ matrix.python }} $CHANNELS --only-deps --dry-run > lockfile
PYTHON_SPEC="${{ matrix.python_spec }}"
if [ -z "${PYTHON_SPEC}" ]; then
PYTHON_SPEC="${{ matrix.python }}"
fi
conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME=${PACKAGE_VERSION} python="${PYTHON_SPEC}" $CHANNELS --only-deps --dry-run > lockfile
cat lockfile
- name: Set pkgs_dirs
run: |
Expand All @@ -204,16 +236,20 @@ jobs:
with:
path: ~/.conda/pkgs
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('lockfile') }}
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-spec-${{ matrix.python == '3.14' && matrix.python_spec == '' && 't' || '' }}-${{hashFiles('lockfile') }}
restore-keys: |
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-spec-${{ matrix.python == '3.14' && matrix.python_spec == '' && 't' || '' }}-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
- name: Install dpctl
run: |
export CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
export TEST_DEPENDENCIES="pytest pytest-cov cython setuptools"
export TEST_DEPENDENCIES="pytest cython setuptools"
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME=${PACKAGE_VERSION} ${TEST_DEPENDENCIES} python=${{ matrix.python }} ${CHANNELS}
PYTHON_SPEC="${{ matrix.python_spec }}"
if [ -z "${PYTHON_SPEC}" ]; then
PYTHON_SPEC="${{ matrix.python }}"
fi
conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME=${PACKAGE_VERSION} ${TEST_DEPENDENCIES} python="${PYTHON_SPEC}" ${CHANNELS}
# Test installed packages
conda list -n ${{ env.TEST_ENV_NAME }}
- name: Smoke test
Expand Down Expand Up @@ -253,6 +289,12 @@ jobs:
strategy:
matrix:
python: ['3.10', '3.11', '3.12', '3.13', '3.14']
python_spec: ['']
include:
- python: '3.14'
python_spec: '3.14.* *_cp314'
experimental: false
runner: windows-latest
experimental: [false]
runner: [windows-latest]
continue-on-error: ${{ matrix.experimental }}
Expand All @@ -272,7 +314,7 @@ jobs:
- name: Download artifact
uses: actions/download-artifact@v7
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python == '3.14' && (matrix.python_spec != '' && '3.14' || '3.14t') || matrix.python }}

- uses: conda-incubator/setup-miniconda@v3
with:
Expand Down Expand Up @@ -329,7 +371,9 @@ jobs:
FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
SET PACKAGE_VERSION=%%F
)
conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
SET "PYTHON_SPEC=${{ matrix.python_spec }}"
IF "%PYTHON_SPEC%"=="" SET "PYTHON_SPEC=${{ matrix.python }}"
conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python="%PYTHON_SPEC%" -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile

- name: Display lockfile content
shell: pwsh
Expand All @@ -342,9 +386,9 @@ jobs:
with:
path: /home/runner/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('lockfile') }}
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-spec-${{ matrix.python == '3.14' && matrix.python_spec == '' && 't' || '' }}-${{hashFiles('lockfile') }}
restore-keys: |
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-spec-${{ matrix.python == '3.14' && matrix.python_spec == '' && 't' || '' }}-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-

- name: Install opencl_rt
Expand All @@ -362,8 +406,10 @@ jobs:
FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
SET PACKAGE_VERSION=%%F
)
SET TEST_DEPENDENCIES=pytest"<8" pytest-cov cython setuptools
conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %TEST_DEPENDENCIES% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
SET "PYTHON_SPEC=${{ matrix.python_spec }}"
IF "%PYTHON_SPEC%"=="" SET "PYTHON_SPEC=${{ matrix.python }}"
SET TEST_DEPENDENCIES=pytest"<8" cython setuptools
conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %TEST_DEPENDENCIES% python="%PYTHON_SPEC%" -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}

- name: Report content of test environment
shell: cmd /C CALL {0}
Expand Down Expand Up @@ -424,16 +470,20 @@ jobs:
strategy:
matrix:
python: ['3.10', '3.11', '3.12', '3.13', '3.14']
python_spec: ['']
include:
- python: '3.14'
python_spec: '3.14.* *_cp314'
steps:
- name: Download conda artifact
uses: actions/download-artifact@v7
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python == '3.14' && (matrix.python_spec != '' && '3.14' || '3.14t') || matrix.python }}

- name: Download wheel artifact
uses: actions/download-artifact@v7
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python }}
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python == '3.14' && (matrix.python_spec != '' && '3.14' || '3.14t') || matrix.python }}

- name: Install anaconda-client
run: conda install anaconda-client -c conda-forge --override-channels
Expand Down Expand Up @@ -468,16 +518,20 @@ jobs:
strategy:
matrix:
python: ['3.10', '3.11', '3.12', '3.13', '3.14']
python_spec: ['']
include:
- python: '3.14'
python_spec: '3.14.* *_cp314'
steps:
- name: Download artifact
uses: actions/download-artifact@v7
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python == '3.14' && (matrix.python_spec != '' && '3.14' || '3.14t') || matrix.python }}

- name: Download wheel artifact
uses: actions/download-artifact@v7
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python }}
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python == '3.14' && (matrix.python_spec != '' && '3.14' || '3.14t') || matrix.python }}

- uses: conda-incubator/setup-miniconda@v3
with:
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/run-tests-from-dppy-bits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
strategy:
matrix:
python: ['3.10', '3.11', '3.12', '3.13', '3.14']
python_spec: ['']
include:
- python: '3.14'
python_spec: '3.14.* *_cp314'
experimental: [false]
runner: [ubuntu-22.04, ubuntu-24.04]
continue-on-error: ${{ matrix.experimental }}
Expand All @@ -47,7 +51,11 @@ jobs:

- name: Install dpctl
run: |
conda create -n ${{ env.TEST_ENV_NAME }} -c dppy/label/dev ${{ env.CHANNELS }} dpctl pytest pytest-cov cython setuptools c-compiler cxx-compiler
PYTHON_SPEC="${{ matrix.python_spec }}"
if [ -z "${PYTHON_SPEC}" ]; then
PYTHON_SPEC="${{ matrix.python }}"
fi
conda create -n ${{ env.TEST_ENV_NAME }} -c dppy/label/dev ${{ env.CHANNELS }} dpctl pytest cython setuptools c-compiler cxx-compiler python="${PYTHON_SPEC}"

- name: Smoke test
run: |
Expand Down Expand Up @@ -79,6 +87,10 @@ jobs:
strategy:
matrix:
python: ['3.10', '3.11', '3.12', '3.13', '3.14']
python_spec: ['']
include:
- python: '3.14'
python_spec: '3.14.* *_cp314'
experimental: [false]
runner: [windows-latest]

Expand Down Expand Up @@ -106,7 +118,9 @@ jobs:

- name: Install dpctl
run: |
conda install -n ${{ env.TEST_ENV_NAME }} -c dppy/label/dev ${{ env.CHANNELS }} dpctl pytest pytest-cov cython setuptools c-compiler cxx-compiler
SET "PYTHON_SPEC=${{ matrix.python_spec }}"
IF "%PYTHON_SPEC%"=="" SET "PYTHON_SPEC=${{ matrix.python }}"
conda install -n ${{ env.TEST_ENV_NAME }} -c dppy/label/dev ${{ env.CHANNELS }} dpctl pytest cython setuptools c-compiler cxx-compiler python="%PYTHON_SPEC%"

# intel-opencl-rt is not being installed when running conda install dpctl, so do it manually
- name: Install intel-opencl-rt
Expand Down
3 changes: 0 additions & 3 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ requirements:
- {{ compiler('dpcpp') }} >={{ required_compiler_version }}
host:
- python
- python-gil # [py>=314]
- pip >=24.0
- level-zero-devel >=1.16
- pybind11 >=2.12
Expand All @@ -52,7 +51,6 @@ requirements:
- tomli # [py<311]
run:
- python
- python-gil # [py>=314]
- {{ pin_compatible('intel-sycl-rt', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('intel-cmplr-lib-rt', min_pin='x.x', max_pin='x') }}
- numpy
Expand All @@ -65,7 +63,6 @@ test:
- cython
- setuptools
- pytest
- pytest-cov

about:
home: https://github.com/IntelPython/dpctl.git
Expand Down
9 changes: 1 addition & 8 deletions conda-recipe/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,4 @@ set -e

${PYTHON} -c "import dpctl; print(dpctl.__version__)"
${PYTHON} -m dpctl -f
# don't use coverage for Python 3.13 due to crashes related to
# Cython >= 3.1.0 and Python >= 3.13
# TODO: remove if crash is triaged
if ${PYTHON} --version 2>&1 | grep -q '^Python 3\.13'; then
${PYTHON} -m pytest -q -ra --disable-warnings --pyargs dpctl -vv
else
${PYTHON} -m pytest -q -ra --disable-warnings --cov dpctl --cov-report term-missing --pyargs dpctl -vv
fi
${PYTHON} -m pytest -q -ra --disable-warnings --pyargs dpctl -vv
5 changes: 5 additions & 0 deletions dpctl/_diagnostics.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# distutils: language = c++
# cython: language_level=3
# cython: linetrace=True
# cython: freethreading_compatible = True

""" Implements developer utilities.
"""
Expand Down Expand Up @@ -60,6 +61,10 @@ def _shutdown_logger():
def syclinterface_diagnostics(verbosity="warning", log_dir=None):
"""Context manager that activate verbosity of DPCTLSyclInterface
function calls.

.. warning::
This context manager modifies the ``DPCTL_VERBOSITY`` environment
variable and should only be used from a single thread.
"""
_allowed_verbosity = ["warning", "error"]
if verbosity not in _allowed_verbosity:
Expand Down
1 change: 1 addition & 0 deletions dpctl/_sycl_context.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# distutils: language = c++
# cython: language_level=3
# cython: linetrace=True
# cython: freethreading_compatible = True

""" Implements SyclContext Cython extension type.
"""
Expand Down
1 change: 1 addition & 0 deletions dpctl/_sycl_device.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# distutils: language = c++
# cython: language_level=3
# cython: linetrace=True
# cython: freethreading_compatible = True

""" Implements SyclDevice Cython extension type.
"""
Expand Down
Loading
Loading