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

Remove cuda::proclaim_return_type from nested lambda #14607

Merged
merged 2 commits into from
Dec 11, 2023

Conversation

ttnghia
Copy link
Contributor

@ttnghia ttnghia commented Dec 10, 2023

This removes cuda::proclaim_return_type from a device lambda because that lambda is going to be nested inside another device lambda, which is in turn enclosed by cuda::proclaim_return_type.

This PR is to fix a compile issue that we encountered:

/usr/local/cuda/include/cuda/std/detail/libcxx/include/__functional/invoke.h(402): error: 
calling a __device__ function("cudf::tdigest::detail::_NV_ANON_NAMESPACE::build_output_column(int,   
  ::std::unique_ptr<   ::cudf::column,     ::std::default_delete<   ::cudf::column> >  &&,     ::std::unique_ptr<   ::cudf::column,     ::std::default_delete<   ::cudf::column> >  &&,     ::std::unique_ptr<   ::cudf::column,     ::std::default_delete<   ::cudf::column> >  &&,     ::std::unique_ptr<   ::cudf::column,     ::std::default_delete<   ::cudf::column> >  &&,     ::std::unique_ptr<   ::cudf::column,     ::std::default_delete<   ::cudf::column> >  &&, bool,  ::rmm::cuda_stream_view,  ::rmm::mr::device_memory_resource *)
::[lambda(int) (instance 2)]::operator ()(int) const") from a __host__ __device__ function("__invoke") is not allowed

Note: The issue is reproducible only in our build environment: ARM architecture, cuda 12 + rockylinux8.

Closes #14610.

Signed-off-by: Nghia Truong <nghiat@nvidia.com>
@ttnghia ttnghia added bug Something isn't working 3 - Ready for Review Ready for review by team libcudf Affects libcudf (C++/CUDA) code. Spark Functionality that helps Spark RAPIDS labels Dec 10, 2023
@ttnghia ttnghia requested a review from bdice December 10, 2023 17:34
@ttnghia ttnghia self-assigned this Dec 10, 2023
@ttnghia ttnghia requested a review from a team as a code owner December 10, 2023 17:34
@ttnghia ttnghia requested a review from vuule December 10, 2023 17:34
@ttnghia ttnghia added the non-breaking Non-breaking change label Dec 10, 2023
@davidwendt
Copy link
Contributor

Perhaps @bdice should verify this does not break his CCCL PR. #14576

@bdice
Copy link
Contributor

bdice commented Dec 11, 2023

Perhaps @bdice should verify this does not break his CCCL PR. #14576

I’ll verify this as soon as possible.

Signed-off-by: Nghia Truong <nghiat@nvidia.com>
Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

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

I confirmed that #14576 builds with this change. I noted in #14610 that we should file an issue with CCCL that documents the compiler versions / etc. used to trigger this error, with a minimal reproduction (especially since RAPIDS CI doesn't complain). The proclaim_return_type wrapper should not break normal device lambda compilation.

@ttnghia
Copy link
Contributor Author

ttnghia commented Dec 11, 2023

/merge

@rapids-bot rapids-bot bot merged commit fcaebeb into rapidsai:branch-24.02 Dec 11, 2023
67 checks passed
karthikeyann pushed a commit to karthikeyann/cudf that referenced this pull request Dec 12, 2023
This removes `cuda::proclaim_return_type` from a device lambda because that lambda is going to be nested inside another device lambda, which is in turn enclosed by `cuda::proclaim_return_type`. 

This PR is to fix a compile issue that we encountered:
```
/usr/local/cuda/include/cuda/std/detail/libcxx/include/__functional/invoke.h(402): error: 
calling a __device__ function("cudf::tdigest::detail::_NV_ANON_NAMESPACE::build_output_column(int,   
  ::std::unique_ptr<   ::cudf::column,     ::std::default_delete<   ::cudf::column> >  &&,     ::std::unique_ptr<   ::cudf::column,     ::std::default_delete<   ::cudf::column> >  &&,     ::std::unique_ptr<   ::cudf::column,     ::std::default_delete<   ::cudf::column> >  &&,     ::std::unique_ptr<   ::cudf::column,     ::std::default_delete<   ::cudf::column> >  &&,     ::std::unique_ptr<   ::cudf::column,     ::std::default_delete<   ::cudf::column> >  &&, bool,  ::rmm::cuda_stream_view,  ::rmm::mr::device_memory_resource *)
::[lambda(int) (instance 2)]::operator ()(int) const") from a __host__ __device__ function("__invoke") is not allowed
```

Note: The issue is reproducible only in our build environment: ARM architecture, cuda 12 + rockylinux8.

Closes rapidsai#14610.

Authors:
  - Nghia Truong (https://github.com/ttnghia)

Approvers:
  - Michael Schellenberger Costa (https://github.com/miscco)
  - Karthikeyan (https://github.com/karthikeyann)
  - https://github.com/nvdbaranec
  - Bradley Dice (https://github.com/bdice)

URL: rapidsai#14607
@ttnghia ttnghia deleted the fix_tdigest_agg branch December 12, 2023 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team bug Something isn't working libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change Spark Functionality that helps Spark RAPIDS
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[BUG] compile error tdigest_aggregation.cu on cuda 12.2 on arm64
6 participants