-
Notifications
You must be signed in to change notification settings - Fork 769
[NFCI][SYCL] Remove boost::mp11
dependency from invoke_simd.hpp
#15713
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
Conversation
C++17 implementation is about as readable as boost-based one, and we want to drop the external boost dependency for upstreaming purposes.
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.
wow cool, thanks
@aelovikov-intel, please, remove fetching boost::mp11 from cmake files. |
I haven't eliminated all the uses yet. |
The main reason to add boost::m11 is the compilation speed. If you won't be able to remove all uses of boost::m11, I'm not sure if it's worth removing it from |
IIRC, that was true for sorting properties and then recently for typelist machinery in @rolandschulz 's PR. ESIMD use-case was added during C++14 timeframe and was done for readability mostly. I've already prototyped complete removal of typelists usages, and the team has agreed that properties speedup is the sacrifice we're willing to make for the ease of upstreaming. |
@AlexeySachkov and I are working on reducing the compilation time for SYCL sources. We would like to avoid patches making compilation slower.
Did you measure the compile time impact? We need to have some data to make the right decision. |
I just asked @uditagarwal97 , we didn't make any measurements for #8168, so that was driven by readability mostly. As for my changes, I'm looking at I also think that whenever performance is an issue, the test has to be added as part of the optimization. Without such test, readability/maintainability trumps any speculated performance of an "optimization". |
I suppose this way of testing doesn't instantiate property templates. I would check the impact on SYCL-CTS compile time.
Agree. |
return std::pair{num_found, found_sg_size}; | ||
}(); | ||
|
||
constexpr auto num_found = x.first; |
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.
nit: slightly less verbose with structured binding.
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.
Not allowed in constexpr
context, sadly. I tried constexpr auto [...] = []() { .... }();
.
I thought the most problematic case for us is multiple small TUs where |
If I get it right, we must instantiate template classes/methods using compile time properties to see the compilation time difference between boost::m11 and hand-written templates. W/o instantiating we measure only parsing time, which is also significant, but it won't expose the compile time benefits of boost::m11. I suppose the parse time for boost::m11 is even worse. @intel/dpcpp-cfe-reviewers can correct me if I wrong. We see template instantiation takes significant time for the code we use internally, but I don't know if compile time properties are involved. They should be covered by SYCL-CTS. |
We expect properties to be used more in the future, because we expect more extensions to depend on it and expect properties to become part of the core spec. The current sorting isn't very efficient. q-sort is slow for (many) small lists (the common case). Merge sort (or insertion sort for small lists) is faster. But it isn't just sorting which has an impact on compile speed. The version which uses set/map is: #13776 |
@bader , I think the discussion about properties is unrelated to this PR, and removing boost dependency from |
I think they are related. The purpose of this change to remove dependency on boost m11 eventually. If we unable to remove this dependency for the rest of the project, there is not much value in this change. |
Assuming the plan is to remove mp11 as a dep and that this doesn't have a significant effect on compilation time, it's fine with me. |
I think the former is true, and as for the "compilation speed or have other cons", CI is green, and the removed code doesn't mention any specific test cases the time has to be measured on prior to removal. Anyway, @sarnex , WDYT? |
E2E tests' time for the CI in this PR is very close the recent pulldown task at https://github.com/intel/llvm/actions/runs/11369991775. IMO, that's a good enough indication of "doesn't have a significant effect on compilation time". |
I understand we don't have any tests or written requirements about the compilation time, but can you please just humor me and compile |
|
thanks, seems within margin of error to me so im fine with this patch, thx again |
C++17 implementation is about as readable as boost-based one, and we want to drop the external boost dependency for upstreaming purposes.