Skip to content
Draft
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
462 changes: 462 additions & 0 deletions .github/workflows/conda-package-cf.yml

Large diffs are not rendered by default.

50 changes: 50 additions & 0 deletions conda-recipe-cf/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
:: conda-forge folds the Intel compiler runtime libs (libircmt.lib, ...) into the
:: build-only dpcpp_impl package (not visible from the host env), so they live
:: in the build prefix and are off the linker's default LIB
set "LIB=%BUILD_PREFIX%\Library\lib;%LIB%"

"%PYTHON%" setup.py clean --all

set "MKLROOT=%PREFIX%/Library"
set "TBB_ROOT_HINT=%PREFIX%/Library"
set "DPL_ROOT_HINT=%PREFIX%/Library"
:: useful for building in resources constrained VMs (public CI)
set "CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=FALSE"

:: try to detect SYCL resource/include dir from icpx
for /f "usebackq delims=" %%R in (`icpx --print-resource-dir 2^>NUL`) do (
set "SYCL_RESOURCE_DIR=%%R"
)

if defined SYCL_RESOURCE_DIR (
if exist "%SYCL_RESOURCE_DIR%\include" (
set "SYCL_INCLUDE_DIR_HINT=%SYCL_RESOURCE_DIR%"
)
)


set "CC=icx"
set "CXX=icx"

set "CMAKE_GENERATOR=Ninja"
:: make CMake verbose
set "VERBOSE=1"

:: set CMAKE to use less threads to avoid OOM
set CMAKE_BUILD_PARALLEL_LEVEL=%CPU_COUNT%

:: flags mean: --wheel --no-isolation --skip-dependency-check
%PYTHON% -m build -w -n -x
if %errorlevel% neq 0 exit 1

:: wheel file was renamed
for /f %%f in ('dir /b /S .\dist') do (
%PYTHON% -m pip install %%f ^
--no-build-isolation ^
--no-deps ^
--only-binary :all: ^
--no-index ^
--prefix %PREFIX% ^
-vv
if errorlevel 1 exit 1
)
49 changes: 49 additions & 0 deletions conda-recipe-cf/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash

# conda-forge folds the Intel compiler runtime libs (libircmt.lib, ...) into the
# build-only dpcpp_impl package (not visible from the host env), so they live
# in the build prefix and are off the linker's default LIBRARY_PATH
export LIBRARY_PATH="$LIBRARY_PATH:${BUILD_PREFIX}/lib"

# Intel LLVM must cooperate with compiler and sysroot from conda
echo "--gcc-toolchain=${BUILD_PREFIX} --sysroot=${BUILD_PREFIX}/${HOST}/sysroot -target ${HOST}" > icpx_for_conda.cfg

ICPXCFG="$(pwd)/icpx_for_conda.cfg"
export ICPXCFG

ICXCFG="$(pwd)/icpx_for_conda.cfg"
export ICXCFG

if [ -e "_skbuild" ]; then
${PYTHON} setup.py clean --all
fi

export CC=icx
export CXX=icpx

# conda-forge's gcc/g++ activation injects -fno-merge-constants into CFLAGS/CXXFLAGS
# when CONDA_BUILD==1, while icx/icpx doesn't support it and emit the warning.
# See CMPLRLLVM-19167 / CMPLRLLVM-28729 for more context and PR which added the flag:
# https://github.com/conda-forge/ctng-compiler-activation-feedstock/pull/193
export CFLAGS="${CFLAGS//-fno-merge-constants/}"
export CXXFLAGS="${CXXFLAGS//-fno-merge-constants/}"

export CMAKE_GENERATOR=Ninja
# Make CMake verbose
export VERBOSE=1

# set CMAKE to use less threads to avoid OOM
export CMAKE_BUILD_PARALLEL_LEVEL=${CPU_COUNT}

CMAKE_ARGS="${CMAKE_ARGS} -DDPNP_WITH_REDIST:BOOL=ON"

# -wnx flags mean: --wheel --no-isolation --skip-dependency-check
${PYTHON} -m build -w -n -x

${PYTHON} -m pip install dist/dpnp*.whl \
--no-build-isolation \
--no-deps \
--only-binary :all: \
--no-index \
--prefix "${PREFIX}" \
-vv
18 changes: 18 additions & 0 deletions conda-recipe-cf/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
numpy:
- '2'
c_compiler: # [linux]
- gcc # [linux]
cxx_compiler: # [linux]
- gxx # [linux]
cxx_compiler_version: # [linux]
- '15' # [linux]
c_stdlib: # [linux]
- sysroot # [linux]
c_stdlib_version: # [linux]
- '2.28' # [linux]
c_stdlib: # [win]
- vs # [win]
cxx_compiler: # [win]
- vs2022 # [win]
c_compiler: # [win]
- vs2022 # [win]
98 changes: 98 additions & 0 deletions conda-recipe-cf/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{% set required_compiler_and_mkl_version = "2026.0.0" %}
{% set required_dpctl_version = "0.22.1" %}

{% set pyproject = load_file_data('pyproject.toml') %}
{% set py_build_deps = pyproject.get('build-system', {}).get('requires', []) %}

package:
name: dpnp
version: {{ GIT_DESCRIBE_TAG }}

source:
path: ..

build:
number: {{ GIT_DESCRIBE_NUMBER }}
ignore_run_exports:
- dpctl
- numpy
- python
# building with Intel DPC++ and do not import the MSVC runtime DLLs
- vc14_runtime # [win]
- ucrt # [win]
missing_dso_whitelist:
- '*DPCTLSyclInterface*'
- '*/dpnp_backend_c.dll' # [win]
skip: true # [osx or py<39]

requirements:
build:
- {{ compiler('cxx') }}
- {{ stdlib('c') }}
- {{ compiler('dpcpp') }} >={{ required_compiler_and_mkl_version }}
- ninja >=1.11.1 # [linux]
- cmake >=3.29.0
host:
- python
- pip >=25.0
- pybind11 >=3.0.2
- setuptools >=79.0.1
- wheel >=0.45.1
- python-build >=1.1
- scikit-build >=0.18.1
- cython >=3.1.0
- numpy >=1.26.0
- versioneer ==0.29
# versioneer dependency
- tomli # [py<311]
- dpctl >={{ required_dpctl_version }}
- mkl-devel-dpcpp >={{ required_compiler_and_mkl_version }}
- onedpl-devel
- tbb-devel
run:
- python
- {{ pin_compatible('dpctl', min_pin='x.x.x', max_pin=None) }}
- {{ pin_compatible('dpcpp-cpp-rt', min_pin='x.x', max_pin='x') }}
- {{ 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') }}
- {{ pin_compatible('mkl', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('onemkl-sycl-blas', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('onemkl-sycl-dft', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('onemkl-sycl-lapack', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('onemkl-sycl-rng', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('onemkl-sycl-vm', min_pin='x.x', max_pin='x') }}
- numpy
- ocl-icd-system # [linux]
- khronos-opencl-icd-loader # [win]

test:
requires:
- pip
- pytest
- setuptools
- scipy # [py<314]
commands:
- pip check
- python -c "import dpnp; print(dpnp.__version__)"
- python -m dpctl -f

about:
home: https://github.com/IntelPython/dpnp
license: BSD-3-Clause
license_file: LICENSE.txt
summary: 'Data Parallel Extension for NumPy'
description: |
<strong>LEGAL NOTICE: Use of this software package is subject to the
software license agreement (as set forth above, in the license section of
the installed Conda package and/or the README file) and all notices,
disclaimers or license terms for third party or open source software
included in or with the software.</strong>
<br/><br/>
EULA: <a href="https://opensource.org/licenses/BSD-3-Clause" target="_blank">BSD-3-Clause</a>
<br/><br/>

extra:
recipe-maintainers:
- antonwolfy
- vlad-perevezentsev
- ndgrigorian
16 changes: 16 additions & 0 deletions conda-recipe-cf/run_test.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@echo on

:: Skip tensor tests by default to avoid OOM in conda builds.
:: Set SKIP_TENSOR_TESTS=0 to run them on machines with enough memory.
if not defined SKIP_TENSOR_TESTS (
set "SKIP_TENSOR_TESTS=1"
)

"%PYTHON%" -c "import dpnp; print(dpnp.__version__)"
if %errorlevel% neq 0 exit 1

"%PYTHON%" -m dpctl -f
if %errorlevel% neq 0 exit 1

"%PYTHON%" -m pytest -ra --pyargs dpnp
if %errorlevel% neq 0 exit 1
13 changes: 13 additions & 0 deletions conda-recipe-cf/run_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# Skip tensor tests by default to avoid OOM in conda builds.
# Set SKIP_TENSOR_TESTS=0 to run them on machines with enough memory.
if [ -z "${SKIP_TENSOR_TESTS}" ]; then
export SKIP_TENSOR_TESTS=1
fi

set -e

$PYTHON -c "import dpnp; print(dpnp.__version__)"
$PYTHON -m dpctl -f
$PYTHON -m pytest -ra --pyargs dpnp
2 changes: 2 additions & 0 deletions dpnp/tests/test_array_api_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
is_win_platform,
numpy_version,
)
from dpnp.tests.third_party.cupy.testing import with_requires

info = dpnp.__array_namespace_info__()
default_device = select_default_device()
Expand Down Expand Up @@ -129,6 +130,7 @@ def test_dtypes_invalid_device():
info.dtypes(device="str")


@with_requires("dpctl>=0.23.0dev0")
def test_devices():
devices = info.devices()
assert isinstance(devices, tuple)
Expand Down
Loading