Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dpctl support for numpy 2.0 in runtime #1735

Merged
merged 4 commits into from
Jul 18, 2024

Conversation

oleksandr-pavlyk
Copy link
Collaborator

@oleksandr-pavlyk oleksandr-pavlyk commented Jul 16, 2024

Changes that allow dpctl pass tests with NumPy 2.0 in the runtime environment

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • If this PR is a work in progress, are you opening the PR as a draft?

Introduced dpctl.tensor._numpy_helper which imports
AxisError, normalize_axis_index, normalize_axis_tuple
conditionally based on np.lib.NumpyVersion

Changed codebase to import these qualifiers from this
new module instead of directly from numpy.

Updated pre-commit versions to resolve oddball warning.
@oleksandr-pavlyk oleksandr-pavlyk changed the title Dpctl support numpy 2.0 Dpctl support for numpy 2.0 in runtime Jul 16, 2024
Copy link

github-actions bot commented Jul 16, 2024

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

Copy link

Array API standard conformance tests for dpctl=0.18.0dev0=py310h15de555_109 ran successfully.
Passed: 895
Failed: 14
Skipped: 105

@coveralls
Copy link
Collaborator

coveralls commented Jul 16, 2024

Coverage Status

coverage: 87.953% (-0.01%) from 87.967%
when pulling 4df7704 on dpctl-support-numpy-2.0
into 71901c7 on master.

Copy link
Collaborator

@antonwolfy antonwolfy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it mean that we can relax the upper bound of run numpy dependency for dpctl in meta.yaml?

@oleksandr-pavlyk
Copy link
Collaborator Author

Does it mean that we can relax the upper bound of run numpy dependency for dpctl in meta.yaml?

Yes, assuming we'd build dpctl with NumPy 2. See notes in the summary of conda-forge/mkl_fft-feedstock#65 PR opened by autobot.

Copy link

Array API standard conformance tests for dpctl=0.18.0dev0=py310h15de555_110 ran successfully.
Passed: 894
Failed: 15
Skipped: 105

@@ -34,7 +34,7 @@ requirements:
- wheel
run:
- python
- {{ pin_compatible('numpy', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('numpy', min_pin='x.x') }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is still unavailable to install dpctl with numpy 2.0 due to run dependency:

$ mamba search -i dpctl -c /localdisk/work/antonvol/bits/dpctl/channel --override-channels
Loading channels: done
dpctl 0.18.0dev0 py311h15de555_110
----------------------------------
file name   : dpctl-0.18.0dev0-py311h15de555_110.tar.bz2
name        : dpctl
version     : 0.18.0dev0
build       : py311h15de555_110
build number: 110
size        : 21.6 MB
license     : Apache-2.0
subdir      : linux-64
url         : file:///localdisk/work/antonvol/bits/dpctl/channel/linux-64/dpctl-0.18.0dev0-py311h15de555_110.tar.bz2
md5         : 829d9a7446399b7c36d96cf2789c8653
timestamp   : 2024-07-17 12:34:07 UTC
dependencies:
  - __glibc >=2.28,<3.0.a0
  - dpcpp-cpp-rt >=2024.0
  - level-zero
  - libgcc-ng >=14
  - libstdcxx-ng >=14
  - numpy >=1.23,<2.0a0
  - numpy >=1.23.5,<2.0a0
  - python >=3.11,<3.12.0a0
  - python_abi 3.11.* *_cp311

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am building the recipe using conda-forge channel only which is now possible thanks to work by @ZzEeKkAa to check if the issue is on the dpctl side, or tangled in the metainformation of build-time dependencies.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same thing observed when building with conda-forge channel only.

(base) opavlyk@opavlyk-mobl:~/repos/dpctl$ mamba search -c local dpctl=0.18* --info
Loading channels: done
dpctl 0.18.0dev0 py312h498558c_106
----------------------------------
file name   : dpctl-0.18.0dev0-py312h498558c_106.tar.bz2
name        : dpctl
version     : 0.18.0dev0
build       : py312h498558c_106
build number: 106
size        : 21.5 MB
license     : Apache-2.0
subdir      : linux-64
url         : file:///home/opavlyk/mamba/conda-bld/linux-64/dpctl-0.18.0dev0-py312h498558c_106.tar.bz2
md5         : a41578215faceef29b06565753347b65
timestamp   : 2024-07-17 21:44:31 UTC
dependencies:
  - __glibc >=2.28,<3.0.a0
  - dpcpp-cpp-rt >=2024.0
  - dpcpp-cpp-rt >=2024.2.0,<2025.0a0
  - level-zero
  - libgcc-ng >=14
  - libstdcxx-ng >=14
  - numpy >=1.26,<2.0a0
  - numpy >=1.26.4,<2.0a0
  - python >=3.12,<3.13.0a0
  - python_abi 3.12.* *_cp312

When building with {{conda build -c conda-forge --python=3.12 --numpy=2.0 --no-test conda-recipe/}} while replacing {{ pin_compatible('numpy', min_pin='x.x', max_pin='x') }} with numpy I get:

(base) opavlyk@opavlyk-mobl:~/repos/dpctl$ mamba search -c local dpctl=0.18* --info
Loading channels: done
dpctl 0.18.0dev0 py312hdf72452_106
----------------------------------
file name   : dpctl-0.18.0dev0-py312hdf72452_106.tar.bz2
name        : dpctl
version     : 0.18.0dev0
build       : py312hdf72452_106
build number: 106
size        : 21.5 MB
license     : Apache-2.0
subdir      : linux-64
url         : file:///home/opavlyk/mamba/conda-bld/linux-64/dpctl-0.18.0dev0-py312hdf72452_106.tar.bz2
md5         : c7164cb903872e171a3afa55881190a8
timestamp   : 2024-07-18 02:26:01 UTC
dependencies:
  - __glibc >=2.28,<3.0.a0
  - dpcpp-cpp-rt >=2024.0
  - dpcpp-cpp-rt >=2024.2.0,<2025.0a0
  - level-zero
  - libgcc-ng >=14
  - libstdcxx-ng >=14
  - numpy >=1.19,<3
  - python >=3.12,<3.13.0a0
  - python_abi 3.12.* *_cp312

I therefore am going to revert the attempted change to solve meta information and defer that to another PR.

Copy link

Array API standard conformance tests for dpctl=0.18.0dev0=py310ha798474_130 ran successfully.
Passed: 894
Failed: 15
Skipped: 105

Copy link
Collaborator

@antonwolfy antonwolfy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @oleksandr-pavlyk, LGTM!

@oleksandr-pavlyk oleksandr-pavlyk merged commit d191e97 into master Jul 18, 2024
58 of 70 checks passed
@oleksandr-pavlyk oleksandr-pavlyk deleted the dpctl-support-numpy-2.0 branch July 18, 2024 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants