Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ This release drops support for Python 3.10, making Python 3.11 the minimum requi
* Fixed the example of handling duplicate indices in the `dpnp.tensor.put` docstring, which imported `dpctl.tensor`, did not parse and lost writes when `x` is longer than `indices` [#3165](https://github.com/IntelPython/dpnp/pull/3165)
* Fixed a segfault when setting `writable` on a `Flags` object created without an array [#3168](https://github.com/IntelPython/dpnp/pull/3168)
* Fixed a crash of the OpenCL CPU compiler in `dpnp.sort`, `dpnp.argsort`, `dpnp.tensor.sort` and `dpnp.tensor.argsort` by radix sort of rows of 2049 to 16384 elements [#3191](https://github.com/IntelPython/dpnp/pull/3191)
* Fixed a random segfault of the OpenCL CPU runtime in coverage builds by instrumenting only host code [#3193](https://github.com/IntelPython/dpnp/pull/3193)

### Security

Expand Down
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,12 @@ mark_as_advanced(
)

if(DPNP_GENERATE_COVERAGE)
# Host only: device counters become device globals in every kernel image of
# their module, which crash the OpenCL CPU runtime, and never reach the profile
Comment on lines +378 to +379

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The counts can reach a profile with this toolchain (see the review), so the reason could name what drops them in dpnp:

Suggested change
# Host only: device counters become device globals in every kernel image of
# their module, which crash the OpenCL CPU runtime, and never reach the profile
# Host only: device counters become device globals in every kernel image of
# their module and crash the OpenCL CPU runtime. Their counts are lost anyway:
# libsycl, loaded by dpctl first, never binds __sycl_increment_profile_counters

string(
CONCAT PROFILE_FLAGS
"-fprofile-instr-generate "
"-fcoverage-mapping "
"-Xarch_host -fprofile-instr-generate "
"-Xarch_host -fcoverage-mapping "
"-fno-sycl-use-footer "
# "-save-temps=obj "
)
Expand Down
4 changes: 1 addition & 3 deletions dpnp/cmake/tensor_build_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ endif()
# Remove global coverage flags for tensor
# use link-time only approach like dpctl
if(DPNP_GENERATE_COVERAGE)
string(REPLACE "-fprofile-instr-generate " "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE "-fcoverage-mapping " "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE "-fno-sycl-use-footer " "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE "${PROFILE_FLAGS}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endif()

# Tensor-specific debug flags
Expand Down
7 changes: 6 additions & 1 deletion dpnp/libtensor/source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,12 @@ foreach(_src_fn ${_dpnp_sources})
"${_clang_prefix}-fno-finite-math-only"
)
if(DPNP_GENERATE_COVERAGE)
# host only, as PROFILE_FLAGS in the top-level CMakeLists.txt

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This conflicts with master now, here and in CHANGELOG.md. #3138 made the dpnp sources of the radix select modules host only with _dpnp_radix_select_sources: the AND NOT _src_fn IN_LIST _dpnp_radix_select_sources condition on this line, the list's entry in the set_property below, and the comment there that ends with "The device counts never reach the profile anyway". With this change every source in _dpnp_sources is host only, so the rebase can drop the list, the condition, the entry and that part of the comment. I resolved it that way for my runs, and the rebased build then has no device counter in any module, _statistics_impl and _tensor_sorting_impl included.

list(
APPEND _combined_options_prop
-Xarch_host
-fprofile-instr-generate
-Xarch_host
-fcoverage-mapping
-fno-sycl-use-footer
)
Expand Down Expand Up @@ -413,7 +416,9 @@ foreach(python_module_name ${_py_trgts})
if(DPNP_TENSOR_GENERATE_COVERAGE_FOR_PYBIND11_EXTENSIONS)
target_compile_options(
${python_module_name}
PRIVATE -fprofile-instr-generate -fcoverage-mapping
PRIVATE
"SHELL:-Xarch_host -fprofile-instr-generate"
"SHELL:-Xarch_host -fcoverage-mapping"
)
endif()
target_link_options(
Expand Down
Loading