Skip to content
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

[FEA][DISCUSSION] Require C++17 #736

Closed
4 tasks done
harrism opened this issue Mar 23, 2021 · 16 comments
Closed
4 tasks done

[FEA][DISCUSSION] Require C++17 #736

harrism opened this issue Mar 23, 2021 · 16 comments
Labels
feature request New feature or request inactive-30d question Further information is requested

Comments

@harrism
Copy link
Member

harrism commented Mar 23, 2021

In 0.20, RAPIDS libraries including libcudf will beginning adopting C++17 features in their implementations and likely require C++17 for their interfaces. We would like to do the same in RMM; however, since RMM is header-only, there is no difference between requiring C++17 for interfaces vs. implementation. (Note RAPIDS will deprecate CUDA 10.x starting with the 0.19 release and require CUDA 11.0 or higher starting with the 0.20 release.)

I'm opening this issue to discuss any concerns with moving to requiring minimum C++17 to compile RMM. This should not affect users CuPy that only interface with the RMM Python API. However, there are other users of RMM C++ outside of core RAPIDS libraries, such as

Can the people I've tagged above please comment on whether you are OK with RMM requiring C++17 starting in release 0.20?

@harrism harrism added feature request New feature or request question Further information is requested labels Mar 23, 2021
@hcho3
Copy link
Contributor

hcho3 commented Mar 23, 2021

I'm okay with it, since RMM is strictly an optional dependency of XGBoost. Users who have an older compiler (GCC 5.x) will be able to build XGBoost without RMM support.

@kkraus14
Copy link
Contributor

cc @shwina @jakirkham for Cython perspective

@shwina
Copy link
Contributor

shwina commented Mar 23, 2021

Not sure if this will affect any of the public APIs that e.g., Python interfaces with. If so, this could potentially be a problem for Cython. Cython does not support many (any?) C++17-specific features. That being said, in many cases, it is possible to write Cython definitions for missingC++17 types/features quite easily. We can explore that on a case-by-case basis (and of course, upstream to Cython if possible).

@jakirkham
Copy link
Member

Agree with Ashwin

IIUC this would also be helpful for solving some issues like host_buffer support ( #260 )

@kkraus14
Copy link
Contributor

One thing that comes to mind for public APIs would be moving from thrust::optional to std::optional, so that's something we'd presumably need to support on the Cython side. Ideally we could prevent leaking the Thrust dependency for RMM Cython.

@harrism
Copy link
Member Author

harrism commented Mar 23, 2021

std::optional is the only C++17 feature I'm aware of that impacts the APIs that Cython would interface with.

@harrism
Copy link
Member Author

harrism commented Mar 23, 2021

IIUC this would also be helpful for solving some issues like host_buffer support ( #260 )

Correct using C++17 std::pmr::memory_resource as a base for host memory resources will help with things like host_buffer.

Also, I assume supporting C++17 will make it easier to depend on the device_memory_resource functionality we are in the process of upstreaming to libcu++, which expands on std::pmr functionality (CC @jrhemstad).

@harrism
Copy link
Member Author

harrism commented Mar 23, 2021

Cython does not support many (any?) C++17-specific features.

@shwina Does Cython support compiling with the --std=c++17 option?

@jakirkham
Copy link
Member

Looks like there is already a Cython issue about std::optional ( cython/cython#3293 ) and the start of a PR ( cython/cython#3294 )

@shwina
Copy link
Contributor

shwina commented Mar 23, 2021

Yes, we can compile with --std=c++17 (or really, any compiler flags of our choosing).

@felipeblazing
Copy link

I don't foresee this being a problem for us though I am guessing some of the changes will require us to do some reworking. We already are going to have to use c++17 for cudf.

@harrism
Copy link
Member Author

harrism commented Apr 1, 2021

@germasch do you have an opinion on this for PSC?

@germasch
Copy link
Contributor

germasch commented Apr 1, 2021

It's not necessarily my preference (neither is requiring CUDA-11) -- in the HPC world, software environments aren't necessarily upgraded all that quickly -- but I can see the point from the perspective of RAPIDS' rapid development ;) I don't think it will cause me any real troubles, though (and if so, I could stick with an older RMM). Thanks for checking!

@harrism
Copy link
Member Author

harrism commented Apr 1, 2021

Totally understand. The RAPIDS team has been waiting for CUDA to support C++17 for a while now. Adoption 4 years after standardization is not super quick. :)

RMM is also trying to better align with C++17 std::pmr::memory_resource

rapids-bot bot pushed a commit that referenced this issue Apr 5, 2021
closes #736

rmm-0.20 increase the minimum requirements in the following way:

- GCC version 9.0+ is required
- CUDA and C++ code now is compiled with `-std=c++17`
- We require CUDA Toolkit version 11.0 or greater

This updates the build-system and the README with these new requirements

Authors:
  - Robert Maynard (https://github.com/robertmaynard)

Approvers:
  - Mark Harris (https://github.com/harrism)
  - Keith Kraus (https://github.com/kkraus14)

URL: #741
@github-actions
Copy link

github-actions bot commented May 1, 2021

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

@kkraus14
Copy link
Contributor

kkraus14 commented May 3, 2021

This was changed in #741 to require C++17. Closing.

@kkraus14 kkraus14 closed this as completed May 3, 2021
rapids-bot bot pushed a commit that referenced this issue Jun 1, 2021
#741 moved the code base over to C++17, and as discussed in #736 moving Cython compilation over is fine as well but has not been done yet. There's some use of structured bindings in there now (in `cuda_async_memory_resource.hpp`) so the Cython compilation should be switched over as well.

Authors:
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - GALI PREM SAGAR (https://github.com/galipremsagar)
  - https://github.com/jakirkham
  - Mark Harris (https://github.com/harrism)

URL: #787
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request inactive-30d question Further information is requested
Projects
None yet
Development

No branches or pull requests

7 participants