Skip to content

Commit b0c02fc

Browse files
authored
Merge pull request #1 from IntelPython/actions
Update ci.yml
2 parents 41d8a89 + ba9ae0c commit b0c02fc

File tree

14 files changed

+56
-60
lines changed

14 files changed

+56
-60
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ env:
1212
IMEX_CACHE_NUMBER: 4 # Increase to reset cache
1313
jobs:
1414
build_and_test:
15-
runs-on: tpi-ubuntu-latest
15+
runs-on: ubuntu-22.04
1616
strategy:
1717
fail-fast: false
1818
steps:

.github/workflows/pre-commit.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ permissions: read-all
99

1010
jobs:
1111
pre-commit:
12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-22.04
1313
steps:
1414
- uses: actions/[email protected]
1515
- uses: actions/setup-python@v5

.pre-commit-config.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.5.0
5+
rev: v4.6.0
66
hooks:
77
- id: check-ast
88
- id: check-builtin-literals
@@ -19,13 +19,13 @@ repos:
1919
- id: trailing-whitespace
2020
exclude: '.*\.patch'
2121
- repo: https://github.com/psf/black
22-
rev: 23.12.0
22+
rev: 24.3.0
2323
hooks:
2424
- id: black
2525
args: ["--line-length", "80"]
2626
language_version: python3
2727
- repo: https://github.com/PyCQA/bandit
28-
rev: '1.7.7'
28+
rev: '1.7.8'
2929
hooks:
3030
- id: bandit
3131
args: ["-c", ".bandit.yml"]
@@ -35,7 +35,7 @@ repos:
3535
- id: isort
3636
name: isort (python)
3737
- repo: https://github.com/pycqa/flake8
38-
rev: 5.0.4
38+
rev: 7.0.0
3939
hooks:
4040
- id: flake8
4141
- repo: https://github.com/pocc/pre-commit-hooks

conda-recipe/build.sh

+27-15
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,28 @@ popd
2727

2828
# skip checkout/build of IMEX/LLVM if there is an install
2929
if [ ! -d "${INSTALLED_DIR}/imex/lib" ]; then
30-
# FIXME work-around as long dpcpp conda packages are incomplete
31-
export SYCL_DIR="/opt/intel/oneapi/compiler/latest/linux"
32-
if [ ! -d "${SYCL_DIR}" ]; then
33-
export SYCL_DIR="/opt/intel/oneapi/compiler/latest"
34-
if [ ! -d "${SYCL_DIR}" ]; then
35-
echo "Fatal error: SYCL_DIR not found"
36-
exit 1
37-
fi
38-
fi
39-
# export SYCL_DIR=${CONDA_PREFIX}
40-
echo "Using SYCLDIR=${SYCL_DIR}"
30+
export SYCL_DIR=${CONDA_PREFIX}
31+
echo "Using SYCL_DIR=${SYCL_DIR}"
32+
33+
# grrrr
34+
# as long as the conda packages differ from system oneAPI installs we need to explicitly provide the include dir for SYCL
35+
# see also below in cmake call
36+
# for root in "${CONDA_PREFIX}" "${BUILD_PREFIX}"; do
37+
# spirvdir=$(find "${root}" -type d -name __spirv | head -n 1)
38+
# if [ -d "${spirvdir}" ]; then
39+
# SPIRV_INC_DIR=$(dirname "${spirvdir}")
40+
# break
41+
# fi
42+
# done
43+
# if [ -d "${SPIRV_INC_DIR}" ]; then
44+
# echo "Using SPIRV_INC_DIR=${SPIRV_INC_DIR}"
45+
# mkdir -p "${SRC_DIR}/grrrr/include"
46+
# ln -s "${SPIRV_INC_DIR}" "${SRC_DIR}/grrrr/include/CL"
47+
# SPIRV_INC_DIR="${SRC_DIR}/grrrr/include"
48+
# else
49+
# echo "Fatal error: SPIRV_INC_DIR not found"
50+
# exit 1
51+
# fi
4152

4253
rm -rf ${INSTALLED_DIR}/imex
4354
IMEX_SHA=$(cat imex_version.txt)
@@ -83,10 +94,11 @@ if [ ! -d "${INSTALLED_DIR}/imex/lib" ]; then
8394
-DLLVM_ENABLE_ZSTD=OFF \
8495
-DLLVM_ENABLE_ZLIB=OFF \
8596
-DLLVM_EXTERNAL_PROJECTS="Imex" \
86-
-DLLVM_EXTERNAL_IMEX_SOURCE_DIR=. \
87-
-DLEVEL_ZERO_DIR=${INSTALLED_DIR}/level-zero \
88-
-DIMEX_ENABLE_SYCL_RUNTIME=1 \
89-
-DIMEX_ENABLE_L0_RUNTIME=1
97+
-DLLVM_EXTERNAL_IMEX_SOURCE_DIR=.
98+
# -DLEVEL_ZERO_DIR=${INSTALLED_DIR}/level-zero \
99+
# -DIMEX_ENABLE_SYCL_RUNTIME=1 \
100+
# -DIMEX_ENABLE_L0_RUNTIME=1 \
101+
# -DCMAKE_CXX_FLAGS="-I${SPIRV_INC_DIR}" # grrrr
90102
cmake --build build
91103
cmake --install build --prefix=${INSTALLED_DIR}/imex
92104
popd

conda-recipe/meta.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ requirements:
2929

3030
build:
3131
- {{compiler('gxx')}}
32-
- sysroot_linux-64 >=2.28 # [linux]
33-
# - dpcpp_linux-64 # [linux]
34-
# - dpcpp_win-64 # [win]
32+
- sysroot_linux-64 # [linux]
33+
# - sysroot_linux-64 >=2.28 # [linux]
34+
- dpcpp_linux-64 >=2024.1 # [linux]
35+
- dpcpp_win-64 # [win]
3536
# - {{compiler('dpcpp')}} >={{required_compiler_and_mkl_version}},!={{excluded_compiler_version1}},!={{excluded_compiler_version2}} # [not osx]
3637
run:
3738
- numpy x.x

examples/black_scholes.py

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
python black_scholes.py -p M16Gb -b numpy
2323
2424
"""
25+
2526
import argparse
2627
import os
2728
import time as time_mod

examples/shallow_water.py

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
python shallow_water.py -b numpy ...
2424
2525
"""
26+
2627
import argparse
2728
import math
2829
import os

examples/wave_equation.py

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
python wave_equation.py -b numpy ...
2424
2525
"""
26+
2627
import argparse
2728
import math
2829
import os

sharpy/array_api.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
distributed implementation of the array API as defined here:
44
https://data-apis.org/array-api/latest
55
"""
6+
67
from collections import OrderedDict
78

89
api_categories = OrderedDict(

sharpy/ndarray.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
The array class for sharpy, a distributed implementation of the
33
array API as defined here: https://data-apis.org/array-api/latest
44
"""
5+
56
#
67
# See __init__.py for an implementation overview
78
#

src/LinAlgOp.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
#include <mpi.h>
8-
//#include <mkl.h>
8+
// #include <mkl.h>
99
#include "sharpy/Factory.hpp"
1010
#include "sharpy/LinAlgOp.hpp"
1111
#include "sharpy/NDArray.hpp"

src/_sharpy.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ void init(bool cw, const std::string &libidtr) {
149149
VT(VT_begin, vtWaitSym); \
150150
py::gil_scoped_release release; \
151151
Service::run(); \
152-
auto r = (_f).get().get() -> _a(); \
152+
auto r = (_f).get().get()->_a(); \
153153
VT(VT_end, vtWaitSym); \
154154
return r
155155

src/include/sharpy/CppTypes.hpp

+11-33
Original file line numberDiff line numberDiff line change
@@ -63,39 +63,17 @@ enum _RANKS : rank_type {
6363
};
6464

6565
template <typename T> struct DTYPE {};
66-
template <> struct DTYPE<double> {
67-
constexpr static DTypeId value = FLOAT64;
68-
};
69-
template <> struct DTYPE<float> {
70-
constexpr static DTypeId value = FLOAT32;
71-
};
72-
template <> struct DTYPE<int64_t> {
73-
constexpr static DTypeId value = INT64;
74-
};
75-
template <> struct DTYPE<int32_t> {
76-
constexpr static DTypeId value = INT32;
77-
};
78-
template <> struct DTYPE<int16_t> {
79-
constexpr static DTypeId value = INT16;
80-
};
81-
template <> struct DTYPE<int8_t> {
82-
constexpr static DTypeId value = INT8;
83-
};
84-
template <> struct DTYPE<uint64_t> {
85-
constexpr static DTypeId value = UINT64;
86-
};
87-
template <> struct DTYPE<uint32_t> {
88-
constexpr static DTypeId value = UINT32;
89-
};
90-
template <> struct DTYPE<uint16_t> {
91-
constexpr static DTypeId value = UINT16;
92-
};
93-
template <> struct DTYPE<uint8_t> {
94-
constexpr static DTypeId value = UINT8;
95-
};
96-
template <> struct DTYPE<bool> {
97-
constexpr static DTypeId value = BOOL;
98-
};
66+
template <> struct DTYPE<double> { constexpr static DTypeId value = FLOAT64; };
67+
template <> struct DTYPE<float> { constexpr static DTypeId value = FLOAT32; };
68+
template <> struct DTYPE<int64_t> { constexpr static DTypeId value = INT64; };
69+
template <> struct DTYPE<int32_t> { constexpr static DTypeId value = INT32; };
70+
template <> struct DTYPE<int16_t> { constexpr static DTypeId value = INT16; };
71+
template <> struct DTYPE<int8_t> { constexpr static DTypeId value = INT8; };
72+
template <> struct DTYPE<uint64_t> { constexpr static DTypeId value = UINT64; };
73+
template <> struct DTYPE<uint32_t> { constexpr static DTypeId value = UINT32; };
74+
template <> struct DTYPE<uint16_t> { constexpr static DTypeId value = UINT16; };
75+
template <> struct DTYPE<uint8_t> { constexpr static DTypeId value = UINT8; };
76+
template <> struct DTYPE<bool> { constexpr static DTypeId value = BOOL; };
9977

10078
template <DTypeId DT> struct TYPE {};
10179
template <> struct TYPE<FLOAT64> {

test/test_spmd.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import numpy as np
22
import pytest
3+
from mpi4py import MPI
34
from utils import device
45

56
import sharpy as sp
6-
from mpi4py import MPI
77
from sharpy import _sharpy_cw
88

99

0 commit comments

Comments
 (0)