Skip to content

Commit

Permalink
Merge branch 'IntelPython:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
adarshyoga authored Oct 3, 2024
2 parents a59b83b + 0b59bd2 commit 2d5cb5c
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_and_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ jobs:
with:
fetch-depth: 0

# intel:numpy for python 3.11 is not upstreamed yet
# numpy for python 3.11 is not upstreamed yet
- name: Patch numpy dependency for Python 3.11
if: matrix.python == '3.11'
shell: bash -l {0}
run: |
find ./environments -type f | xargs sed -i 's/intel::numpy/numpy/'
find ./environments -type f | xargs sed -i 's/numpy/numpy/'
find ./environments -type f | xargs sed -i 's/setuptools>=42,<64/setuptools/'
- name: Setup miniconda
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
PACKAGE_NAME: dpbench
MODULE_NAME: dpbench
# There is a separate action that removes defaults.
CHANNELS: 'dppy/label/dev,conda-forge,intel,nodefaults'
CHANNELS: 'dppy/label/dev,conda-forge,https://software.repos.intel.com/python/conda,nodefaults'
VER_JSON_NAME: 'version.json'
VER_SCRIPT1: "import json; f = open('version.json', 'r'); j = json.load(f); f.close(); "
VER_SCRIPT2: "d = j['dpbench'][0]; print('='.join((d[s] for s in ('version', 'build'))))"
Expand All @@ -33,7 +33,7 @@ jobs:
fail-fast: false
matrix:
python: ['3.9', '3.10', '3.11']
os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest, windows-2019]

runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:
cat ${{ env.VER_JSON_PATH }}
- name: Install dpbench
run: conda install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} pytest intel::intel-opencl-rt python=${{ matrix.python }} -c ${{ env.CHANNEL_PATH }}
run: conda install ${{ env.PACKAGE_NAME }}=${{ env.PACKAGE_VERSION }} pytest intel-opencl-rt python=${{ matrix.python }} -c ${{ env.CHANNEL_PATH }}

- name: Setup OpenCL CPU device
if: runner.os == 'Windows'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ SPDX-License-Identifier: Apache-2.0
1. Create conda environment

```bash
conda create -n dpbench dpbench -c dppy/label/dev -c conda-forge -c intel -c nodefaults --override-channels
conda create -n dpbench dpbench -c dppy/label/dev -c conda-forge -c https://software.repos.intel.com/python/conda -c nodefaults --override-channels
conda activate dpbench
```

Expand Down
11 changes: 11 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!--
SPDX-FileCopyrightText: 2022 - 2023 Intel Corporation
SPDX-License-Identifier: Apache-2.0
-->

# Security Policy
Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution, impact, severity and mitigation.

## Reporting a Vulnerability
Please report any security vulnerabilities in this project utilizing the guidelines [here](https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html).
1 change: 1 addition & 0 deletions dpbench/benchmarks/default/l2_norm/l2_norm_numba_dpex_p.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
@dpjit
def l2_norm(a, d):
for i in nb.prange(a.shape[0]):
d[i] = 0.0
for k in range(a.shape[1]):
d[i] += np.square(a[i, k])
d[i] = np.sqrt(d[i])
1 change: 1 addition & 0 deletions dpbench/benchmarks/default/l2_norm/l2_norm_numba_mlir_p.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
@nb.njit(parallel=True, fastmath=True)
def _l2_norm(a, d):
for i in numba.prange(a.shape[0]):
d[i] = 0.0
for k in range(a.shape[1]):
d[i] += np.square(a[i, k])
d[i] = np.sqrt(d[i])
Expand Down
1 change: 1 addition & 0 deletions dpbench/benchmarks/default/l2_norm/l2_norm_numba_npr.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
@nb.njit(parallel=True, fastmath=True)
def l2_norm(a, d):
for i in nb.prange(a.shape[0]):
d[i] = 0.0
for k in range(a.shape[1]):
d[i] += np.square(a[i, k])
d[i] = np.sqrt(d[i])
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ void l2_norm_impl(queue Queue,
.submit([&](handler &h) {
h.parallel_for<theKernel<FpTy>>(range<1>{npoints}, [=](id<1> myID) {
size_t i = myID[0];
d[i] = 0.0;
for (size_t k = 0; k < dims; k++) {
d[i] += a[i * dims + k] * a[i * dims + k];
}
Expand Down
2 changes: 1 addition & 1 deletion dpbench/configs/bench_info/pca.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ output_args = [
"evalues",
"evectors",
]
expected_failure_implementations = ["numba_dpex_n"]
expected_failure_implementations = ["numba_dpex_n", "numba_n", "numpy", "numba_np", "dpnp"]

[benchmark.parameters.S]
npoints = 1024
Expand Down
2 changes: 1 addition & 1 deletion dpbench/configs/framework_info/dpcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ postfix = "dpcpp"
class = "DpcppFramework"
arch = "cpu"
sycl_device = "cpu"
dpcpp_version = "IntelLLVM 2024.1.0"
dpcpp_version = "IntelLLVM 2024.2.1"

[[framework.postfixes]]
impl_postfix = "sycl"
Expand Down
10 changes: 5 additions & 5 deletions environments/conda-linux-sycl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
name: dpbench-dev
channels:
- dppy/label/dev
- https://software.repos.intel.com/python/conda
- conda-forge
- intel
- nodefaults
dependencies:
- pip
Expand All @@ -18,13 +18,13 @@ dependencies:
- scikit-learn
- versioneer
- pandas
- intel::numpy
- numpy
- numba
- dpctl
- dpnp
- numba-dpex
- intel::dpcpp_linux-64
- intel::dpcpp-cpp-rt
- numba-dpex>=0.23.0*
- dpcpp_linux-64
- dpcpp-cpp-rt
- cython
- cmake
- ninja
Expand Down
8 changes: 4 additions & 4 deletions environments/conda-win-sycl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
name: dpbench-dev
channels:
- dppy/label/dev
- https://software.repos.intel.com/python/conda
- conda-forge
- intel
- nodefaults
dependencies:
- pip
Expand All @@ -18,22 +18,22 @@ dependencies:
- scikit-learn
- versioneer
- pandas
- intel::numpy
- numpy
- numba
- dpctl
- dpnp
- numba-dpex
# TODO: switch to conda-forge, but it results in broken OpenCL rt (see below)
# - conda-forge::dpcpp_win-64
- intel::dpcpp_win-64
- dpcpp_win-64
# fixing cmake version here, because we need to apply patch for IntelLLVM
- cmake==3.26*
- cython
- scikit-build
# TODO: switch to khronos, sycl-ls works fine, but dpctl can't select device.
# set's OpenCL runtime (better version of intel-opencl-rt)
# - khronos-opencl-icd-loader
- intel::intel-opencl-rt # need for set-intel-ocl-icd-registry.ps1
- intel-opencl-rt # need for set-intel-ocl-icd-registry.ps1
# https://github.com/scikit-build/scikit-build/issues/981
- setuptools>=42,<64
- pybind11
8 changes: 4 additions & 4 deletions environments/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
name: dpbench-dev
channels:
- dppy/label/dev
- https://software.repos.intel.com/python/conda
- conda-forge
- intel
- nodefaults
dependencies:
- pip
Expand All @@ -18,9 +18,9 @@ dependencies:
- scikit-learn
- versioneer
- pandas
- intel::intel-opencl-rt # need for set-intel-ocl-icd-registry.ps1
- intel::numpy
- intel-opencl-rt # need for set-intel-ocl-icd-registry.ps1
- numpy
- numba
- dpctl
- dpnp
- numba-dpex
- numba-dpex>=0.23.0*

0 comments on commit 2d5cb5c

Please sign in to comment.