Skip to content

Commit

Permalink
Merge pull request #1653 from IntelPython/merge_to_gold
Browse files Browse the repository at this point in the history
Merge `0.13.1dev1` from master to gold
  • Loading branch information
antonwolfy authored Jan 9, 2024
2 parents 6501ffe + 9c63896 commit e62d607
Show file tree
Hide file tree
Showing 85 changed files with 8,898 additions and 4,488 deletions.
42 changes: 27 additions & 15 deletions .github/workflows/build-sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ on:
types: [opened, synchronize, reopened, closed]

env:
GH_BOT_NAME: 'github-actions[bot]'
GH_BOT_EMAIL: 'github-actions[bot]@users.noreply.github.com'
GH_EVENT_OPEN_PR_UPSTREAM: ${{ github.event_name == 'pull_request' && github.event.action != 'closed' &&
github.event.pull_request && !github.event.pull_request.head.repo.fork }}
GH_EVENT_PUSH_UPSTREAM: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' &&
github.event.ref == 'refs/heads/master' && github.event.repository && !github.event.repository.fork }}
PUBLISH_DIR: doc/_build/html/

defaults:
Expand Down Expand Up @@ -91,7 +97,7 @@ jobs:
- name: Install dpnp dependencies
run: |
conda install numpy"<1.24" dpctl">=0.15.1dev1" mkl-devel-dpcpp onedpl-devel tbb-devel dpcpp_linux-64 \
conda install numpy"<1.24" dpctl">=0.15.1dev2" mkl-devel-dpcpp onedpl-devel tbb-devel dpcpp_linux-64"<2024.0.1" \
cmake cython pytest ninja scikit-build sysroot_linux-64">=2.28" ${{ env.CHANNELS }}
- name: Install cuPy dependencies
Expand Down Expand Up @@ -125,36 +131,40 @@ jobs:
working-directory: 'dpnp/backend/doc'

- name: Copy backend docs
run: cp -r dpnp/backend/doc/html doc/_build/html/backend_doc
run: cp -r dpnp/backend/doc/html ${{ env.PUBLISH_DIR }}/backend_doc

# https://github.com/marketplace/actions/github-pages-action
# The step is only used to build docs while pushing a PR to "master"
- name: Deploy docs
if: |
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/'))
if: env.GH_EVENT_PUSH_UPSTREAM
uses: peaceiris/actions-gh-pages@v3.9.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ env.PUBLISH_DIR }}
keep_files: true
commit_message: ${{ github.event.head_commit.message }}
publish_branch: gh-pages
user_name: ${{ env.GH_BOT_NAME }}
user_email: ${{ env.GH_BOT_EMAIL }}

# The step is only used to build docs while pushing to PR branch
- name: Publish pull-request docs
if: |
github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action != 'closed'
if: env.GH_EVENT_OPEN_PR_UPSTREAM
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 }}
commit_message: ${{ github.event.pull_request.title }}
publish_branch: gh-pages
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
user_name: ${{ env.GH_BOT_NAME }}
user_email: ${{ env.GH_BOT_EMAIL }}

# The step is only used to build docs while pushing to PR branch
- 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'
if: env.GH_EVENT_OPEN_PR_UPSTREAM
env:
PR_NUM: ${{ github.event.number }}
uses: mshick/add-pr-comment@v2.8.1
Expand All @@ -163,9 +173,11 @@ jobs:
View rendered docs @ https://intelpython.github.io/dpnp/pull/${{ env.PR_NUM }}/index.html
allow-repeats: false

# The job is only used to build docs when PR is closed (action from PR branch)
clean:
if: |
github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action == 'closed'
github.event_name == 'pull_request' && github.event.action == 'closed' &&
github.event.pull_request && !github.event.pull_request.head.repo.fork
needs: build-and-deploy

Expand All @@ -185,8 +197,8 @@ jobs:
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 config --global user.name ${{ env.GH_BOT_NAME }}
git config --global user.email ${{ env.GH_BOT_EMAIL }}
git commit -m "Removing docs for closed pull request ${PR_NUM}"
git push tokened_docs gh-pages
Expand Down
15 changes: 6 additions & 9 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ env:
# TODO: to add test_arraymanipulation.py back to the scope once crash on Windows is gone
TEST_SCOPE: >-
test_arraycreation.py
test_amin_amax.py
test_dot.py
test_dparray.py
test_copy.py
Expand All @@ -24,28 +25,24 @@ env:
test_random_state.py
test_sort.py
test_special.py
test_statistics.py
test_sycl_queue.py
test_umath.py
test_usm_type.py
third_party/cupy/core_tests
third_party/cupy/linalg_tests/test_product.py
third_party/cupy/linalg_tests/test_solve.py
third_party/cupy/logic_tests/test_comparison.py
third_party/cupy/logic_tests/test_truth.py
third_party/cupy/manipulation_tests/test_basic.py
third_party/cupy/manipulation_tests/test_dims.py
third_party/cupy/manipulation_tests/test_join.py
third_party/cupy/manipulation_tests/test_rearrange.py
third_party/cupy/manipulation_tests/test_transpose.py
third_party/cupy/math_tests/test_arithmetic.py
third_party/cupy/math_tests/test_explog.py
third_party/cupy/math_tests/test_floating.py
third_party/cupy/math_tests/test_hyperbolic.py
third_party/cupy/math_tests/test_matmul.py
third_party/cupy/math_tests/test_misc.py
third_party/cupy/math_tests/test_rounding.py
third_party/cupy/math_tests/test_trigonometric.py
third_party/cupy/math_tests
third_party/cupy/sorting_tests/test_sort.py
third_party/cupy/sorting_tests/test_count.py
third_party/cupy/statistics_tests/test_meanvar.py
VER_JSON_NAME: 'version.json'
VER_SCRIPT1: "import json; f = open('version.json', 'r'); j = json.load(f); f.close(); "
VER_SCRIPT2: "d = j['dpnp'][0]; print('='.join((d[s] for s in ('version', 'build'))))"
Expand Down Expand Up @@ -422,7 +419,7 @@ jobs:
run: conda install anaconda-client

- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3.5.2
with:
repository: IntelPython/devops-tools
fetch-depth: 0
Expand Down
22 changes: 19 additions & 3 deletions .github/workflows/generate_coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

env:
python-ver: '3.10'
CHANNELS: '-c dppy/label/dev -c intel -c conda-forge --override-channels'
CHANNELS: '-c dppy/label/coverage -c intel -c conda-forge --override-channels'

steps:
- name: Cancel Previous Runs
Expand All @@ -42,17 +42,33 @@ jobs:
- name: Install dpnp dependencies
run: |
# use DPC++ compiler 2023.2 to work around an issue with crash
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 }}
dpctl">=0.15.1dev2" dpcpp_linux-64"=2023.2" sysroot_linux-64">=2.28" mkl-devel-dpcpp tbb-devel"=2021.10" \
onedpl-devel ${{ env.CHANNELS }}
- name: Conda info
run: |
conda info
conda list
- name: Build dpnp with coverage
id: build_coverage
uses: nick-fields/retry@v2.9.0
with:
shell: bash
timeout_minutes: 60
max_attempts: 5
retry_on: error
command: |
. $CONDA/etc/profile.d/conda.sh
conda activate coverage
git clean -fxd
python scripts/gen_coverage.py --pytest-opts="--ignore tests/test_random.py"
- name: Total number of coverage attempts
run: |
python scripts/gen_coverage.py --pytest-opts="--ignore tests/test_random.py"
echo "Total number of coverage attempts made: ${{ steps.build_coverage.outputs.total_attempts }}"
- name: Install coverall dependencies
run: |
Expand Down
11 changes: 7 additions & 4 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{% set required_compiler_and_mkl_version = "2024.0" %}
{% set required_dpctl_version = "0.15.1dev2" %}

package:
name: dpnp
version: {{ GIT_DESCRIBE_TAG }}
Expand All @@ -13,19 +16,19 @@ requirements:
- cmake >=3.21
- ninja
- git
- dpctl >=0.15.1dev1
- mkl-devel-dpcpp {{ environ.get('MKL_VER', '>=2024.0.0') }}
- dpctl >={{ required_dpctl_version }}
- mkl-devel-dpcpp >={{ required_compiler_and_mkl_version }}
- onedpl-devel
- tbb-devel
- wheel
- scikit-build
build:
- {{ compiler('cxx') }}
- {{ compiler('dpcpp') }} >=2024.0.0 # [not osx]
- {{ compiler('dpcpp') }} >={{ required_compiler_and_mkl_version }} # [not osx]
- sysroot_linux-64 >=2.28 # [linux]
run:
- python
- dpctl >=0.15.1dev1
- {{ 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('mkl-dpcpp', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('numpy', min_pin='x.x', max_pin='x') }}
Expand Down
2 changes: 2 additions & 0 deletions doc/reference/math.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Trigonometric functions
dpnp.unwrap
dpnp.deg2rad
dpnp.rad2deg
dpnp.reduce_hypot


Hyperbolic functions
Expand Down Expand Up @@ -94,6 +95,7 @@ Exponents and logarithms
dpnp.log1p
dpnp.logaddexp
dpnp.logaddexp2
dpnp.logsumexp


Other special functions
Expand Down
1 change: 1 addition & 0 deletions dpnp/backend/extensions/lapack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
set(python_module_name _lapack_impl)
set(_module_src
${CMAKE_CURRENT_SOURCE_DIR}/lapack_py.cpp
${CMAKE_CURRENT_SOURCE_DIR}/gesv.cpp
${CMAKE_CURRENT_SOURCE_DIR}/heevd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/syevd.cpp
)
Expand Down
55 changes: 55 additions & 0 deletions dpnp/backend/extensions/lapack/common_helpers.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
//*****************************************************************************
// Copyright (c) 2023, Intel Corporation
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
// THE POSSIBILITY OF SUCH DAMAGE.
//*****************************************************************************

#pragma once
#include <cstring>
#include <stdexcept>

namespace dpnp
{
namespace backend
{
namespace ext
{
namespace lapack
{
namespace helper
{
template <typename T>
struct value_type_of
{
using type = T;
};

template <typename T>
struct value_type_of<std::complex<T>>
{
using type = T;
};
} // namespace helper
} // namespace lapack
} // namespace ext
} // namespace backend
} // namespace dpnp
Loading

0 comments on commit e62d607

Please sign in to comment.