Skip to content

Commit

Permalink
Merge pull request #1533 from IntelPython/merge_to_gold2
Browse files Browse the repository at this point in the history
Development milestone 0.12.2dev1
  • Loading branch information
antonwolfy authored Aug 23, 2023
2 parents ff9bed2 + 70d2781 commit 81b7861
Show file tree
Hide file tree
Showing 149 changed files with 12,790 additions and 3,969 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ exclude =
conda.recipe,
tests/*.py,
tests_external/*.py,
version.py,
versioneer.py,

# Print detailed statistic if any issue detected
count = True
Expand Down
96 changes: 88 additions & 8 deletions .github/workflows/build-sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@ on:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, closed]

env:
PUBLISH_DIR: doc/_build/html/

defaults:
run:
shell: bash -l {0}

jobs:
build-and-deploy:
name: Build and Deploy Docs

runs-on: ubuntu-20.04

defaults:
run:
shell: bash -l {0}

env:
python-ver: '3.9'
CHANNELS: '-c dppy/label/dev -c intel -c conda-forge --override-channels'
Expand All @@ -25,6 +29,12 @@ jobs:
with:
access_token: ${{ github.token }}

- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo "$GITHUB_CONTEXT"
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
Expand Down Expand Up @@ -61,6 +71,8 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3.5.2
with:
fetch-depth: 0

# https://github.com/marketplace/actions/setup-miniconda
- name: Setup miniconda
Expand All @@ -79,8 +91,8 @@ jobs:
- name: Install dpnp dependencies
run: |
conda install dpctl mkl-devel-dpcpp onedpl-devel tbb-devel dpcpp_linux-64 \
cmake cython"<3" pytest ninja scikit-build sysroot_linux-64">=2.28" ${{ env.CHANNELS }}
conda install numpy"<1.24" dpctl mkl-devel-dpcpp onedpl-devel tbb-devel dpcpp_linux-64 \
cmake cython pytest ninja scikit-build sysroot_linux-64">=2.28" ${{ env.CHANNELS }}
- name: Install cuPy dependencies
run: conda install cupy cudatoolkit=10.0
Expand All @@ -99,6 +111,13 @@ jobs:
run: make html
working-directory: doc

- name: Set a project number to current release
run: |
export PROJECT_NUMBER=$(git describe --tags --abbrev=0)
echo PROJECT_NUMBER=${PROJECT_NUMBER}
echo "PROJECT_NUMBER=$PROJECT_NUMBER" >> $GITHUB_ENV
# https://github.com/marketplace/actions/doxygen-action
- name: Build backend docs
uses: mattnotmitt/doxygen-action@v1.9.5
Expand All @@ -111,9 +130,70 @@ jobs:
# https://github.com/marketplace/actions/github-pages-action
- name: Deploy docs
if: |
!github.event.pull_request.head.repo.fork &&
github.event.pull_request && !github.event.pull_request.head.repo.fork &&
(github.ref == 'refs/heads/master' || (startsWith(github.ref, 'refs/heads/release') == true) || github.event_name == 'push' && contains(github.ref, 'refs/tags/'))
uses: peaceiris/actions-gh-pages@v3.9.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: doc/_build/html/
publish_dir: ${{ env.PUBLISH_DIR }}

- name: Publish pull-request docs
if: |
github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action != 'closed'
uses: peaceiris/actions-gh-pages@v3.9.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ env.PUBLISH_DIR }}
destination_dir: ./pull/${{ github.event.number }}
allow_empty_commit : true
keep_files: true
commit_message: ${{ github.event.head_commit.message }}
publish_branch: gh-pages
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'

- name: Comment with URL to published pull-request docs
if: |
github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action != 'closed'
env:
PR_NUM: ${{ github.event.number }}
uses: mshick/add-pr-comment@v2.8.1
with:
message: |
View rendered docs @ https://intelpython.github.io/dpnp/pull/${{ env.PR_NUM }}/index.html
allow-repeats: false

clean:
if: |
github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action == 'closed'
needs: build-and-deploy

runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3.5.2
with:
fetch-depth: 0

- name: Remove docs [PR closed]
env:
PR_NUM: ${{ github.event.number }}
run: |
git remote add tokened_docs https://IntelPython:${{ secrets.GITHUB_TOKEN }}@github.com/IntelPython/dpnp.git
git fetch tokened_docs
git checkout --track tokened_docs/gh-pages
echo `pwd`
[ -d pull/${PR_NUM} ] && git rm -rf pull/${PR_NUM}
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git commit -m "Removing docs for closed pull request ${PR_NUM}"
git push tokened_docs gh-pages
- name: Modify the comment with URL to official documentation
uses: mshick/add-pr-comment@v2.8.1
with:
find: |
View rendered docs @.+
replace: |
View rendered docs @ https://intelpython.github.io/dpnp/index.html
29 changes: 18 additions & 11 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,25 @@ env:
PACKAGE_NAME: dpnp
MODULE_NAME: dpnp
CHANNELS: '-c dppy/label/dev -c intel -c conda-forge --override-channels'
# TODO: to add test_arraymanipulation.py back to the scope once crash on Windows is gone
TEST_SCOPE: >-
test_arraycreation.py
test_dot.py
test_dparray.py
test_fft.py
test_linalg.py
test_logic.py
test_manipulation.py
test_mathematical.py
test_random_state.py
test_sort.py
test_special.py
test_umath.py
test_usm_type.py
third_party/cupy/linalg_tests/test_product.py
third_party/cupy/logic_tests/test_truth.py
third_party/cupy/manipulation_tests/test_basic.py
third_party/cupy/manipulation_tests/test_join.py
third_party/cupy/math_tests/test_explog.py
third_party/cupy/math_tests/test_misc.py
third_party/cupy/math_tests/test_trigonometric.py
Expand All @@ -37,7 +43,7 @@ jobs:

strategy:
matrix:
python: ['3.8', '3.9', '3.10']
python: ['3.8', '3.9', '3.10', '3.11']
os: [ubuntu-20.04, windows-latest]

runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -114,12 +120,10 @@ jobs:

strategy:
matrix:
python: ['3.8', '3.9', '3.10']
python: ['3.8', '3.9', '3.10', '3.11']
os: [ubuntu-20.04, ubuntu-latest]

experimental: [false]

continue-on-error: ${{ matrix.experimental }}
continue-on-error: true

env:
conda-pkgs: '/home/runner/conda_pkgs_dir/'
Expand Down Expand Up @@ -194,7 +198,9 @@ jobs:
run: conda list

- name: Smoke test
run: python -c "import dpnp, dpctl; dpctl.lsplatform()"
run: |
python -c "import dpnp, dpctl; dpctl.lsplatform()"
python -c "import dpnp; print(dpnp.__version__)"
# TODO: run the whole scope once the issues on CPU are resolved
- name: Run tests
Expand All @@ -215,10 +221,9 @@ jobs:

strategy:
matrix:
python: ['3.8', '3.9', '3.10']
experimental: [false]
python: ['3.8', '3.9', '3.10', '3.11']

continue-on-error: ${{ matrix.experimental }}
continue-on-error: true

env:
conda-pkgs: 'C:\Users\runneradmin\conda_pkgs_dir\'
Expand Down Expand Up @@ -331,7 +336,9 @@ jobs:
Get-Content -Tail 5 -Path $cl_cfg
- name: Smoke test
run: python -c "import dpnp, dpctl; dpctl.lsplatform()"
run: |
python -c "import dpnp, dpctl; dpctl.lsplatform()"
python -c "import dpnp; print(dpnp.__version__)"
# TODO: run the whole scope once the issues on CPU are resolved
- name: Run tests
Expand All @@ -346,7 +353,7 @@ jobs:

strategy:
matrix:
python: ['3.8', '3.9', '3.10']
python: ['3.8', '3.9', '3.10', '3.11']
os: [ubuntu-20.04, windows-latest]

runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate_coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
sudo apt-get install lcov
- name: Install dpnp dependencies
run: |
conda install cython"<3" llvm cmake">=3.21" scikit-build ninja pytest pytest-cov coverage[toml] \
conda install cython llvm cmake">=3.21" scikit-build ninja pytest pytest-cov coverage[toml] \
dpctl dpcpp_linux-64 sysroot_linux-64">=2.28" mkl-devel-dpcpp tbb-devel onedpl-devel ${{ env.CHANNELS }}
- name: Conda info
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ jobs:
- uses: actions/checkout@v3.5.2
- uses: actions/setup-python@v4.6.1
with:
python-version: '3.10'
python-version: '3.11'
- uses: pre-commit/action@v3.0.0
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ repos:
- id: rst-inline-touching-normal
- id: text-unicode-replacement-char
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.7.0
hooks:
- id: black
args: ["--check", "--diff", "--color"]
Expand All @@ -59,7 +59,7 @@ repos:
name: isort (pyi)
types: [pyi]
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
args: ["--config=.flake8"]
Expand Down
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.12.2] - TBA

### Added

### Changed

### Fixed

## [0.12.1] - 07/18/2023

### Added
Expand All @@ -23,11 +31,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Added a specialized kernel for `dpnp.sum` with `axis=0` as a pybind11 extension [#1479](https://github.com/IntelPython/dpnp/pull/1479)
* Redesigned `dpnp.square` function through pybind11 extension of OneMKL call where possible or Leveraging on `dpctl.tensor` implementation [#1473](https://github.com/IntelPython/dpnp/pull/1473)
* Redesigned `dpnp.cos` and `dpnp.sin` functions through pybind11 extension of OneMKL calls where possible or Leveraging on `dpctl.tensor` implementation [#1471](https://github.com/IntelPython/dpnp/pull/1471)
* Redesigned `dpnp.sqrt` function through pybind11 extension of OneMKL call where possible or Leveraging on `dpctl.tensor` implementation [#1470](https://github.com/IntelPython/dpnp/pull/1470)
* Redesigned `dpnp.log` function through pybind11 extension of OneMKL call where possible or Leveraging on `dpctl.tensor` implementation [#1469](https://github.com/IntelPython/dpnp/pull/1469)
* Redesigned `dpnp.sqrt` function through pybind11 extension of OneMKL call where possible or leveraging on `dpctl.tensor` implementation [#1470](https://github.com/IntelPython/dpnp/pull/1470)
* Redesigned `dpnp.log` function through pybind11 extension of OneMKL call where possible or leveraging on `dpctl.tensor` implementation [#1469](https://github.com/IntelPython/dpnp/pull/1469)
* Leveraged `dpctl.tensor` implementation for logical operations [#1464](https://github.com/IntelPython/dpnp/pull/1464)
* Leveraged `dpctl.tensor` implementation for `dpnp.floor_divide` function [#1462](https://github.com/IntelPython/dpnp/pull/1462)
* Leveraged `dpctl.tensor` implementation for comparison functions [#1458](https://github.com/IntelPython/dpnp/pull/1458)

### Fixed

* Improved `dpnp.dot` function to support OneMKL calls for input and output arrays with strides [#1477](https://github.com/IntelPython/dpnp/pull/1477)
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ include(GNUInstallDirs)
include(FetchContent)
FetchContent_Declare(
pybind11
URL https://github.com/pybind/pybind11/archive/refs/tags/v2.10.2.tar.gz
URL_HASH SHA256=93bd1e625e43e03028a3ea7389bba5d3f9f2596abc074b068e70f4ef9b1314ae
URL https://github.com/pybind/pybind11/archive/refs/tags/v2.11.1.tar.gz
URL_HASH SHA256=d475978da0cdc2d43b73f30910786759d593a9d8ee05b1b6846d1eb16c6d2e0c
)
FetchContent_MakeAvailable(pybind11)

Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,11 @@ cd dpnp
python scripts/build_locally.py
```

## Install Wheel Package from Pypi
## Install Wheel Package via pip
Install DPNP
```cmd
python -m pip install --index-url https://pypi.anaconda.org/intel/simple --extra-index-url https://pypi.org/simple dpnp
python -m pip install --index-url https://pypi.anaconda.org/intel/simple dpnp
```
Note: DPNP wheel package is placed on Pypi, but some of its dependencies (like Intel numpy) are in Anaconda Cloud.
That is why install command requires additional intel Pypi channel from Anaconda Cloud.

Set path to Performance Libraries in case of using venv or system Python:
```cmd
Expand Down
7 changes: 2 additions & 5 deletions conda-recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/bin/bash

# Workaround to Klocwork overwriting LD_LIBRARY_PATH that was modified
# by DPC++ compiler conda packages. Will need to be added to DPC++ compiler
# activation scripts.
export LDFLAGS="$LDFLAGS -Wl,-rpath,$PREFIX/lib"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PREFIX/compiler/lib/intel64_lin:$PREFIX/compiler/lib:$PREFIX/lib"
# This is necessary to help DPC++ find Intel libraries such as SVML, IRNG, etc in build prefix
export LD_LIBRARY_PATH="$LD_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
Expand Down
6 changes: 3 additions & 3 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ requirements:
- python
- setuptools
- numpy 1.21
- cython <3
- cython
- cmake >=3.21
- ninja
- git
- dpctl >=0.14.5
- mkl-devel-dpcpp {{ environ.get('MKL_VER', '>=2023.1.0') }}
- mkl-devel-dpcpp {{ environ.get('MKL_VER', '>=2023.2.0') }}
- onedpl-devel
- tbb-devel
- wheel
- scikit-build
build:
- {{ compiler('cxx') }}
- {{ compiler('dpcpp') }} >=2023.1.0 # [not osx]
- {{ compiler('dpcpp') }} >=2023.2.0 # [not osx]
- sysroot_linux-64 >=2.28 # [linux]
run:
- python
Expand Down
8 changes: 4 additions & 4 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@
with open("reference/comparison_table.rst.inc", "w") as fd:
fd.write(comparison_generator.generate())

import dpnp

# -- Project information -----------------------------------------------------

project = "dpnp"
project = "Data Parallel Extension for NumPy"
copyright = "2020-2023, Intel Corporation"
author = "Intel"

# The short X.Y version
version = "0.12"
version = dpnp.__version__.strip(".dirty")
# The full version, including alpha/beta/rc tags
release = "0.12.1"
release = dpnp.__version__.strip(".dirty")


# -- General configuration ---------------------------------------------------
Expand Down
Loading

0 comments on commit 81b7861

Please sign in to comment.