-
Notifications
You must be signed in to change notification settings - Fork 221
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
feature(rf optimizations): enabling oneDPL and sort primitive refactoring #3046
Changes from 62 commits
65d9322
f8028b7
0b553e8
2a91928
ab367c0
e053cdf
3f1a6fe
700cd10
809760f
d01ea31
064bb12
6e3587d
0d9edd6
a60eb07
16c8f6c
91410dc
8fd11bb
bf9d31f
4575642
16b1ca5
09995cf
0ecfd35
94b260b
5bdd54f
e7f4066
aaa4546
a7cfed8
b450d82
24cf250
2f397cf
caf932e
cb66c3f
6f64de2
530a00d
9238928
85bd20f
8e14b6b
5a14e25
8a593ca
fe2b79e
5108a3e
319ff4b
e7fa4e8
fc9eba4
9392c7c
11d043c
cc967f9
636beb1
c980790
1397da6
ec41603
f80763f
3ac1595
d8a2252
b250fd4
517f62a
6d969bc
5279e89
996833d
3b1842d
cf7746d
f13eede
dae0fcf
11c2b65
afbaf18
5bdc11f
b027afc
45c9f34
333549c
0ceaa95
f7c5649
8a71af9
87fe44f
34d960b
baf774b
ec0e362
e4df736
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,9 +38,14 @@ function install_tbb { | |
sudo apt-get install -y intel-oneapi-tbb-devel-2022.0 | ||
} | ||
|
||
function install_dpl { | ||
sudo apt-get install -y intel-oneapi-libdpstd-devel | ||
} | ||
|
||
function install_mkl { | ||
sudo apt-get install -y intel-oneapi-mkl-devel-2025.0 | ||
install_tbb | ||
install_dpl | ||
} | ||
|
||
function install_clang-format { | ||
|
@@ -129,6 +134,9 @@ elif [ "${component}" == "tbb" ]; then | |
elif [ "${component}" == "mkl" ]; then | ||
add_repo | ||
install_mkl | ||
elif [ "${component}" == "dpl" ]; then | ||
add_repo | ||
install_dpl | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add to the help list at the end of this file "dpl" |
||
elif [ "${component}" == "gnu-cross-compilers" ]; then | ||
update | ||
install_gnu-cross-compilers "$2" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,6 +90,21 @@ ccl_repo( | |
] | ||
) | ||
|
||
dpl_repo = use_repo_rule("@onedal//dev/bazel/deps:dpl.bzl", "dpl_repo") | ||
dpl_repo( | ||
name = "dpl", | ||
root_env_var = "DPL_ROOT", | ||
urls = [ | ||
"https://files.pythonhosted.org/packages/95/f6/18f78cb933e01ecd9e99d37a10da4971a795fcfdd1d24640799b4050fdbb/onedpl_devel-2022.7.1-py2.py3-none-manylinux_2_28_x86_64.whl", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dumb question, but how do we find these values/maintain them? It looks painful. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we do the same thing for all other packages like tbb and mkl. Find it on pypi and copy links) |
||
], | ||
sha256s = [ | ||
"3b270999d2464c5151aa0e7995dda9e896d072c75069ccee1efae9dc56bdc417", | ||
], | ||
strip_prefixes = [ | ||
"onedpl_devel-2022.7.1.data/data", | ||
], | ||
) | ||
|
||
mkl_repo = use_repo_rule("@onedal//dev/bazel/deps:mkl.bzl", "mkl_repo") | ||
mkl_repo( | ||
name = "mkl", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ dal_module( | |
], | ||
dpc_deps = [ | ||
"@mkl//:mkl_dpc", | ||
"@dpl//:headers", | ||
], | ||
) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
#include "oneapi/dal/table/row_accessor.hpp" | ||
#include "oneapi/dal/backend/memory.hpp" | ||
#include "oneapi/dal/detail/profiler.hpp" | ||
#include <string> | ||
|
||
#ifdef ONEDAL_DATA_PARALLEL | ||
|
||
|
@@ -34,8 +35,15 @@ inline sycl::event sort_inplace(sycl::queue& queue_, | |
pr::ndarray<Float, 1>& src, | ||
const bk::event_vector& deps = {}) { | ||
ONEDAL_ASSERT(src.get_count() > 0); | ||
auto device = queue_.get_device(); | ||
std::string device_name = device.get_info<sycl::info::device::name>(); | ||
auto src_ind = pr::ndarray<Index, 1>::empty(queue_, { src.get_count() }); | ||
return pr::radix_sort_indices_inplace<Float, Index>{ queue_ }(src, src_ind, deps); | ||
if (device_name.find("Data Center GPU Max") != std::string::npos) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This feels dangerous somehow. Definitely add some comments. Ideally device checking should exist as a primitive rather than in an algo because this is a bit of a nasty surprise to anyone not well-versed in this algo when trying to debug on various hardware. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Vika-F planned to add this feature in future |
||
return pr::radix_sort_indices_inplace_dpl<Float, Index>(queue_, src, src_ind, deps); | ||
Alexandr-Solovev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
else { | ||
return pr::radix_sort_indices_inplace<Float, Index>{ queue_ }(src, src_ind, deps); | ||
} | ||
} | ||
|
||
template <typename Float, typename Bin, typename Index> | ||
|
@@ -429,15 +437,36 @@ sycl::event indexed_features<Float, Bin, Index>::operator()(const table& tbl, | |
pr::ndarray<Bin, 1>::empty(queue_, { row_count_ }, sycl::usm::alloc::device); | ||
} | ||
|
||
pr::radix_sort_indices_inplace<Float, Index> sort{ queue_ }; | ||
|
||
sycl::event last_event; | ||
|
||
for (Index i = 0; i < column_count_; i++) { | ||
last_event = extract_column(data_nd_, values_nd, indices_nd, i, { last_event }); | ||
last_event = sort(values_nd, indices_nd, { last_event }); | ||
last_event = | ||
compute_bins(values_nd, indices_nd, column_bin_vec_[i], entries_[i], i, { last_event }); | ||
auto device = queue_.get_device(); | ||
std::string device_name = device.get_info<sycl::info::device::name>(); | ||
if (device_name.find("Data Center GPU Max") != std::string::npos) { | ||
for (Index i = 0; i < column_count_; i++) { | ||
last_event = extract_column(data_nd_, values_nd, indices_nd, i, { last_event }); | ||
last_event = pr::radix_sort_indices_inplace_dpl<Float, Index>(queue_, | ||
values_nd, | ||
indices_nd, | ||
{ last_event }); | ||
last_event = compute_bins(values_nd, | ||
indices_nd, | ||
column_bin_vec_[i], | ||
entries_[i], | ||
i, | ||
{ last_event }); | ||
} | ||
} | ||
else { | ||
pr::radix_sort_indices_inplace<Float, Index> sort{ queue_ }; | ||
for (Index i = 0; i < column_count_; i++) { | ||
last_event = extract_column(data_nd_, values_nd, indices_nd, i, { last_event }); | ||
last_event = sort(values_nd, indices_nd, { last_event }); | ||
last_event = compute_bins(values_nd, | ||
indices_nd, | ||
column_bin_vec_[i], | ||
entries_[i], | ||
i, | ||
{ last_event }); | ||
} | ||
} | ||
|
||
last_event.wait_and_throw(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is dpl a dependency of MKL? I thought tbb was integrated here to install_mkl for that reason
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess mkl and tbb have no deps on each other, but my understanding its a step for install all necessary deps for onedal