Skip to content

Merge changes for nightly tests in CI #1186

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

Merged
merged 26 commits into from
Sep 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
885f91a
dpnp_take_c uses SYCL kernel, no need to use no_sycl parameter in ada…
oleksandr-pavlyk Aug 11, 2022
7220d87
Change to DPNPC_adapter to set/use events upon which deallocation mus…
oleksandr-pavlyk Aug 11, 2022
37386bb
Used DPNPC_ptr_adapter::depends_on
oleksandr-pavlyk Aug 14, 2022
16a7632
Get rid of "Improper Null Termination" issue
antonwolfy Aug 17, 2022
d839ea1
implemented PR feedback
oleksandr-pavlyk Aug 17, 2022
cfc9b40
Merge pull request #1167 from IntelPython/fix-take
oleksandr-pavlyk Aug 18, 2022
818dc82
Reworked solution with a pointer on void
antonwolfy Aug 18, 2022
a8da387
Merge branch 'master' into antonwolfy/checkmarx_fix
antonwolfy Aug 18, 2022
b29d957
Update dpnp/backend/kernels/dpnp_krnl_random.cpp
antonwolfy Aug 18, 2022
629d0e0
Update dpnp/backend/kernels/dpnp_krnl_random.cpp
antonwolfy Aug 18, 2022
ce6d880
Merge pull request #1168 from IntelPython/antonwolfy/checkmarx_fix
antonwolfy Aug 19, 2022
2fed06a
Skip for two more tests till waiting fix (#1171)
xaleryb Aug 24, 2022
9b14f0c
dpnp_take failed on Windows due to memory corruption (#1172)
antonwolfy Aug 30, 2022
59ef493
Merge branch 'gold/2021'
antonwolfy Aug 30, 2022
c91f912
Add workflow for Win
antonwolfy Sep 8, 2022
ac0f6f6
Merge pull request #1176 from antonwolfy/build_and_upload_for_win
oleksandr-pavlyk Sep 8, 2022
31144c6
Attempt to fix workflow
oleksandr-pavlyk Sep 8, 2022
ee65713
attempt to fix upload steps of the workflow on Linux
oleksandr-pavlyk Sep 8, 2022
26d190c
Merge pull request #1177 from IntelPython/finess-conda-package
oleksandr-pavlyk Sep 8, 2022
2ea4aac
Another attempt to fix upload step of conda-package workflow
oleksandr-pavlyk Sep 9, 2022
ac79e9f
Set default shell in upload actions (#1180)
antonwolfy Sep 9, 2022
64478ae
Use pin_compatible for run-time dependency generation on numpy, restr…
oleksandr-pavlyk Sep 9, 2022
5f87d3a
Merge pull request #1178 from IntelPython/use-variant
oleksandr-pavlyk Sep 9, 2022
bd1a414
Reorder channels in conda-build (#1182)
antonwolfy Sep 10, 2022
3be4b2e
Add tests running as a part of github actions (#1184)
antonwolfy Sep 20, 2022
614c829
[Build] setuptools 63.4.1 breaks build for Windows (#1185)
antonwolfy Sep 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
464 changes: 442 additions & 22 deletions .github/workflows/conda-package.yml

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# CMake build and local install directory
build
build_cython

# Byte-compiled / optimized / DLL files
__pycache__/

# Code project files
.vscode

*dpnp_backend*
dpnp/**/*.cpython*.so
dpnp/**/*.pyd
*~
*~
core
8 changes: 8 additions & 0 deletions conda-recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
REM A workaround for activate-dpcpp.bat issue to be addressed in 2021.4
set "LIB=%BUILD_PREFIX%\Library\lib;%BUILD_PREFIX%\compiler\lib;%LIB%"
SET "INCLUDE=%BUILD_PREFIX%\include;%INCLUDE%"

REM Since the 60.0.0 release, setuptools includes a local, vendored copy
REM of distutils (from late copies of CPython) that is enabled by default.
REM It breaks build for Windows, so use distutils from "stdlib" as before.
REM @TODO: remove the setting, once transition to build backend on Windows
REM to cmake is complete.
SET "SETUPTOOLS_USE_DISTUTILS=stdlib"

IF DEFINED DPLROOT (
ECHO "Sourcing DPLROOT"
SET "INCLUDE=%DPLROOT%\include;%INCLUDE%"
Expand Down
10 changes: 5 additions & 5 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ requirements:
host:
- python
- setuptools
- numpy 1.19
- numpy >=1.19,<1.22a0
- cython
- cmake 3.19
- cmake >=3.19
- dpctl >=0.13
- mkl-devel-dpcpp {{ environ.get('MKL_VER', '>=2021.1.1') }}
- tbb-devel
- wheel
build:
- {{ compiler('dpcpp') }}
- dpcpp-cpp-rt {{ environ.get('DPCPP_VER', '>=2021.1.1') }}
- {{ compiler('cxx') }}
- {{ compiler('dpcpp') }} >=2022.1 # [not osx]
run:
- python
- dpctl >=0.13
- {{ pin_compatible('dpcpp-cpp-rt', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('mkl-dpcpp', min_pin='x.x', max_pin='x') }}
- numpy >=1.15
- {{ pin_compatible('numpy', min_pin='x.x', max_pin='x') }}

build:
number: {{ GIT_DESCRIBE_NUMBER }}
Expand Down
49 changes: 31 additions & 18 deletions dpnp/backend/kernels/dpnp_krnl_indexing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -901,10 +901,8 @@ DPCTLSyclEventRef dpnp_take_c(DPCTLSyclQueueRef q_ref,
DPCTLSyclEventRef event_ref = nullptr;
sycl::queue q = *(reinterpret_cast<sycl::queue*>(q_ref));

DPNPC_ptr_adapter<_DataType> input1_ptr(q_ref, array1_in, array1_size);
DPNPC_ptr_adapter<_IndecesType> input2_ptr(q_ref, indices1, size);
_DataType* array_1 = input1_ptr.get_ptr();
_IndecesType* indices = input2_ptr.get_ptr();
_DataType* array_1 = reinterpret_cast<_DataType*>(array1_in);
_IndecesType* indices = reinterpret_cast<_IndecesType*>(indices1);
_DataType* result = reinterpret_cast<_DataType*>(result1);

sycl::range<1> gws(size);
Expand All @@ -920,7 +918,6 @@ DPCTLSyclEventRef dpnp_take_c(DPCTLSyclQueueRef q_ref,
sycl::event event = q.submit(kernel_func);

event_ref = reinterpret_cast<DPCTLSyclEventRef>(&event);

return DPCTLEvent_Copy(event_ref);
}

Expand All @@ -937,6 +934,7 @@ void dpnp_take_c(void* array1_in, const size_t array1_size, void* indices1, void
size,
dep_event_vec_ref);
DPCTLEvent_WaitAndThrow(event_ref);
DPCTLEvent_Delete(event_ref);
}

template <typename _DataType, typename _IndecesType>
Expand Down Expand Up @@ -1073,21 +1071,36 @@ void func_map_init_indexing_func(func_map_t& fmap)
fmap[DPNPFuncName::DPNP_FN_PUT_ALONG_AXIS_EXT][eft_DBL][eft_DBL] = {eft_DBL,
(void*)dpnp_put_along_axis_ext_c<double>};

fmap[DPNPFuncName::DPNP_FN_TAKE][eft_BLN][eft_BLN] = {eft_BLN, (void*)dpnp_take_default_c<bool, int64_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE][eft_INT][eft_INT] = {eft_INT, (void*)dpnp_take_default_c<int32_t, int64_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE][eft_BLN][eft_INT] = {eft_BLN, (void*)dpnp_take_default_c<bool, int32_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE][eft_INT][eft_INT] = {eft_INT, (void*)dpnp_take_default_c<int32_t, int32_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE][eft_LNG][eft_INT] = {eft_LNG, (void*)dpnp_take_default_c<int64_t, int32_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE][eft_FLT][eft_INT] = {eft_FLT, (void*)dpnp_take_default_c<float, int32_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE][eft_DBL][eft_INT] = {eft_DBL, (void*)dpnp_take_default_c<double, int32_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE][eft_C128][eft_INT] = {eft_C128,
(void*)dpnp_take_default_c<std::complex<double>, int32_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE][eft_BLN][eft_LNG] = {eft_BLN, (void*)dpnp_take_default_c<bool, int64_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE][eft_INT][eft_LNG] = {eft_INT, (void*)dpnp_take_default_c<int32_t, int32_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE][eft_LNG][eft_LNG] = {eft_LNG, (void*)dpnp_take_default_c<int64_t, int64_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE][eft_FLT][eft_FLT] = {eft_FLT, (void*)dpnp_take_default_c<float, int64_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE][eft_DBL][eft_DBL] = {eft_DBL, (void*)dpnp_take_default_c<double, int64_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE][eft_C128][eft_C128] = {eft_C128,
(void*)dpnp_take_default_c<std::complex<double>, int64_t>};

fmap[DPNPFuncName::DPNP_FN_TAKE_EXT][eft_BLN][eft_BLN] = {eft_BLN, (void*)dpnp_take_ext_c<bool, int64_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE_EXT][eft_INT][eft_INT] = {eft_INT, (void*)dpnp_take_ext_c<int32_t, int64_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE][eft_FLT][eft_LNG] = {eft_FLT, (void*)dpnp_take_default_c<float, int64_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE][eft_DBL][eft_LNG] = {eft_DBL, (void*)dpnp_take_default_c<double, int64_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE][eft_C128][eft_LNG] = {eft_C128,
(void*)dpnp_take_default_c<std::complex<double>, int64_t>};

// TODO: add a handling of other indexes types once DPCtl implementation of data copy is ready
fmap[DPNPFuncName::DPNP_FN_TAKE_EXT][eft_BLN][eft_INT] = {eft_BLN, (void*)dpnp_take_ext_c<bool, int32_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE_EXT][eft_INT][eft_INT] = {eft_INT, (void*)dpnp_take_ext_c<int32_t, int32_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE_EXT][eft_LNG][eft_INT] = {eft_LNG, (void*)dpnp_take_ext_c<int64_t, int32_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE_EXT][eft_FLT][eft_INT] = {eft_FLT, (void*)dpnp_take_ext_c<float, int32_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE_EXT][eft_DBL][eft_INT] = {eft_DBL, (void*)dpnp_take_ext_c<double, int32_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE_EXT][eft_C128][eft_INT] = {eft_C128,
(void*)dpnp_take_ext_c<std::complex<double>, int32_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE_EXT][eft_BLN][eft_LNG] = {eft_BLN, (void*)dpnp_take_ext_c<bool, int64_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE_EXT][eft_INT][eft_LNG] = {eft_INT, (void*)dpnp_take_ext_c<int32_t, int64_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE_EXT][eft_LNG][eft_LNG] = {eft_LNG, (void*)dpnp_take_ext_c<int64_t, int64_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE_EXT][eft_FLT][eft_FLT] = {eft_FLT, (void*)dpnp_take_ext_c<float, int64_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE_EXT][eft_DBL][eft_DBL] = {eft_DBL, (void*)dpnp_take_ext_c<double, int64_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE_EXT][eft_C128][eft_C128] = {eft_C128,
(void*)dpnp_take_ext_c<std::complex<double>, int64_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE_EXT][eft_FLT][eft_LNG] = {eft_FLT, (void*)dpnp_take_ext_c<float, int64_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE_EXT][eft_DBL][eft_LNG] = {eft_DBL, (void*)dpnp_take_ext_c<double, int64_t>};
fmap[DPNPFuncName::DPNP_FN_TAKE_EXT][eft_C128][eft_LNG] = {eft_C128,
(void*)dpnp_take_ext_c<std::complex<double>, int64_t>};

return;
}
16 changes: 0 additions & 16 deletions scripts/build_conda_package.sh

This file was deleted.

1 change: 1 addition & 0 deletions tests/skipped_tests.tbl
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ tests/test_linalg.py::test_svd[(2,2)-complex128]
tests/test_linalg.py::test_svd[(3,4)-complex128]
tests/test_linalg.py::test_svd[(5,3)-complex128]
tests/test_linalg.py::test_svd[(16,16)-complex128]
tests/test_mathematical.py::TestGradient::test_gradient_y1_dx[3.5-array1]
tests/test_random.py::TestPermutationsTestShuffle::test_shuffle1[lambda x: (dpnp.asarray([(i, i) for i in x], [("a", int), ("b", int)]).view(dpnp.recarray))]
tests/test_random.py::TestPermutationsTestShuffle::test_shuffle1[lambda x: dpnp.asarray([(i, i) for i in x], [("a", object), ("b", dpnp.int32)])]]
tests/test_random.py::TestPermutationsTestShuffle::test_shuffle1[lambda x: dpnp.asarray(x).astype(dpnp.int8)]
Expand Down
13 changes: 0 additions & 13 deletions tests/skipped_tests_gpu.tbl
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,6 @@ tests/test_indexing.py::test_nonzero[[[0, 1, 2], [3, 0, 5], [6, 7, 0]]]
tests/test_indexing.py::test_nonzero[[[0, 1, 0, 3, 0], [5, 0, 7, 0, 9]]]
tests/test_indexing.py::test_nonzero[[[[1, 2], [0, 4]], [[0, 2], [0, 1]], [[0, 0], [3, 1]]]]
tests/test_indexing.py::test_nonzero[[[[[1, 2, 3], [3, 4, 5]], [[1, 2, 3], [2, 1, 0]]], [[[1, 3, 5], [3, 1, 0]], [[0, 1, 2], [1, 3, 4]]]]]
tests/test_indexing.py::test_take[[[0, 1, 2], [3, 4, 5], [6, 7, 8]]-[[0, 0], [0, 0]]]
tests/test_indexing.py::test_take[[[0, 1, 2], [3, 4, 5], [6, 7, 8]]-[[1, 2], [1, 2]]]
tests/test_indexing.py::test_take[[[0, 1, 2], [3, 4, 5], [6, 7, 8]]-[[1, 2], [3, 4]]]
tests/test_indexing.py::test_take[[[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]-[[1, 2], [1, 2]]]
tests/test_indexing.py::test_take[[[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]-[[1, 2], [3, 4]]]
tests/test_indexing.py::test_take[[[[1, 2], [3, 4]], [[1, 2], [2, 1]], [[1, 3], [3, 1]]]-[[1, 2], [1, 2]]]
tests/test_indexing.py::test_take[[[[1, 2], [3, 4]], [[1, 2], [2, 1]], [[1, 3], [3, 1]]]-[[1, 2], [3, 4]]]
tests/test_indexing.py::test_take[[[[[1, 2], [3, 4]], [[1, 2], [2, 1]]], [[[1, 3], [3, 1]], [[0, 1], [1, 3]]]]-[[1, 2], [1, 2]]]
tests/test_indexing.py::test_take[[[[[1, 2], [3, 4]], [[1, 2], [2, 1]]], [[[1, 3], [3, 1]], [[0, 1], [1, 3]]]]-[[1, 2], [3, 4]]]
tests/test_indexing.py::test_take[[[[[1, 2, 3], [3, 4, 5]], [[1, 2, 3], [2, 1, 0]]], [[[1, 3, 5], [3, 1, 0]], [[0, 1, 2], [1, 3, 4]]]]-[[1, 2], [1, 2]]]
tests/test_indexing.py::test_take[[[[[1, 2, 3], [3, 4, 5]], [[1, 2, 3], [2, 1, 0]]], [[[1, 3, 5], [3, 1, 0]], [[0, 1, 2], [1, 3, 4]]]]-[[1, 2], [3, 4]]]
tests/test_indexing.py::test_take[[[[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]], [[[13, 14, 15], [16, 17, 18]], [[19, 20, 21], [22, 23, 24]]]]-[[1, 2], [1, 2]]]
tests/test_indexing.py::test_take[[[[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]], [[[13, 14, 15], [16, 17, 18]], [[19, 20, 21], [22, 23, 24]]]]-[[1, 2], [3, 4]]]
tests/third_party/cupy/creation_tests/test_ranges.py::TestRanges::test_arange_no_dtype_int
tests/third_party/cupy/indexing_tests/test_indexing.py::TestIndexing::test_take_no_axis
tests/third_party/cupy/indexing_tests/test_insert.py::TestPlace_param_3_{n_vals=1, shape=(7,)}::test_place
Expand Down
12 changes: 9 additions & 3 deletions tests/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,12 @@ def test_select():
numpy.testing.assert_array_equal(expected, result)


@pytest.mark.parametrize("array_type",
[numpy.bool8, numpy.int32, numpy.int64, numpy.float32, numpy.float64, numpy.complex128],
ids=['bool8', 'int32', 'int64', 'float32', 'float64', 'complex128'])
@pytest.mark.parametrize("indices_type",
[numpy.int32, numpy.int64],
ids=['int32', 'int64'])
@pytest.mark.parametrize("indices",
[[[0, 0], [0, 0]],
[[1, 2], [1, 2]],
Expand All @@ -395,9 +401,9 @@ def test_select():
'[[[[1, 2], [3, 4]], [[1, 2], [2, 1]]], [[[1, 3], [3, 1]], [[0, 1], [1, 3]]]]',
'[[[[1, 2, 3], [3, 4, 5]], [[1, 2, 3], [2, 1, 0]]], [[[1, 3, 5], [3, 1, 0]], [[0, 1, 2], [1, 3, 4]]]]',
'[[[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]], [[[13, 14, 15], [16, 17, 18]], [[19, 20, 21], [22, 23, 24]]]]'])
def test_take(array, indices):
a = numpy.array(array)
ind = numpy.array(indices)
def test_take(array, indices, array_type, indices_type):
a = numpy.array(array, dtype=array_type)
ind = numpy.array(indices, dtype=indices_type)
ia = dpnp.array(a)
iind = dpnp.array(ind)
expected = numpy.take(a, ind)
Expand Down
2 changes: 1 addition & 1 deletion utils/dpnp_build_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def find_cmplr(verbose=False):
verbose=verbose)

# try to find in Python environment
if not cmplr_include or not mathlib_path:
if not cmplr_include or not cmplr_libpath:
if sys.platform in ['linux']:
rel_include_path = os.path.join('include')
rel_libdir_path = os.path.join('lib')
Expand Down