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

Use libcu++ interfaces. #3297

Merged
merged 5 commits into from
Aug 31, 2021
Merged

Use libcu++ interfaces. #3297

merged 5 commits into from
Aug 31, 2021

Conversation

mzient
Copy link
Contributor

@mzient mzient commented Aug 30, 2021

Signed-off-by: Michał Zientkiewicz mzient@gmail.com

Description

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (Redesign of existing code that doesn't affect functionality)
  • Other (e.g. Documentation, Tests, Configuration)

What happened in this PR

  • It switches from using RMM to libcu++.
  • It implements the simple resources from RMM which we had previously used.
  • It changes the behavior of the linter so that headers without an extension are interpreted as C++

Additional information

Affected modules and functionalities:
  • Memory management
  • Linter

Checklist

Tests

  • Existing tests apply
  • New tests added
    • Python tests
    • GTests
    • Benchmark
    • Other
  • N/A

Documentation

  • Existing documentation applies
  • Documentation updated
    • Docstring
    • Doxygen
    • RST
    • Jupyter
    • Other
  • N/A
    Acknowledgements.

DALI team only

Requirements

  • Implements new requirements
  • Affects existing requirements
  • N/A

REQ IDs: N/A

JIRA TASK: DALI-2268

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [2874299]: BUILD STARTED

@NVIDIA NVIDIA deleted a comment from dali-automaton Aug 30, 2021
@NVIDIA NVIDIA deleted a comment from dali-automaton Aug 30, 2021
@NVIDIA NVIDIA deleted a comment from dali-automaton Aug 30, 2021
@NVIDIA NVIDIA deleted a comment from dali-automaton Aug 30, 2021
@NVIDIA NVIDIA deleted a comment from dali-automaton Aug 30, 2021
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [2874299]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [2879811]: BUILD STARTED

CMakeLists.txt Outdated
@@ -254,6 +254,8 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-command-line-argument")
# Ignore warnings coming from cutlass
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --system-header-prefix=cutlass/")
# Enable SFINAE with ellipsis in device code
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xclang -fcuda-allow-variadic-functions")
Copy link
Member

Choose a reason for hiding this comment

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

This whole if(DALI_CLANG_ONLY) section is about temporarily turning off warnings, that should be addressed (per @klecki comment above). Since this option is not turning off any warning, but enabling a feature, maybe it should be marked appropriately?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, no issue with turning this on, probably split it into warning section and useful feature section.

Copy link
Contributor Author

@mzient mzient Aug 31, 2021

Choose a reason for hiding this comment

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

I can move the comment and run build stage only again if you REALLY insist.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done - I had to fix basename extraction in linter, so another build is in order.

@@ -163,12 +162,14 @@ void AsyncPoolTest(Pool &pool, vector<block> &blocks, Mutex &mtx, CUDAStream &st
CUDA_CALL(cudaMemsetAsync(ptr, fill, size, stream));
{
std::lock_guard<Mutex> guard(mtx);
(void)guard; // for dummy mutexes
Copy link
Member

Choose a reason for hiding this comment

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

Could you explain this? I'm not sure I understand this line correctly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sometimes (in the tests) the mutex is a dummy object where the lock/unlock functions are empty and the compiler is smart enough to see that the construction/destruction has no effect and emits a warning.

[submodule "third_party/thrust"]
path = third_party/thrust
url = https://github.com/NVIDIA/thrust
[submodule "third_party/libcudacxx"]
path = third_party/libcudacxx
url = https://github.com/mzient/libcudacxx.git
Copy link
Member

Choose a reason for hiding this comment

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

Is linking from your private fork on purpose?

Copy link
Contributor Author

@mzient mzient Aug 31, 2021

Choose a reason for hiding this comment

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

It's not been upstreamed yet, so yes, it's necessary for the time being.
See: NVIDIA/libcudacxx#158

@@ -4480,7 +4480,8 @@ def _ClassifyInclude(fileinfo, include, is_system):
or include.endswith(".hpp") \
or include.endswith(".hxx") \
or include.endswith(".H") \
or include.endswith(".hh")
or include.endswith(".hh") \
or '.' not in include[include.rfind('/')] # no extension
Copy link
Member

Choose a reason for hiding this comment

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

Are we sure we want this? I recall you saying, that that's in order to have #include <cuda/memory_resource> recognized as C++. However, we are not really running linter for third party headers, so I don't feel it's necessary to run it for <cuda/memory_resource>. On the other hand, this may lead to strange linter behaviour in future.

@banasraf , what's your opinion about it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

If I understand correctly, it's not about running linter on a third party header, but about ordering of includes. Linter requires some certain order of includes, and this change is to correctly qualify the cuda/memory_resource as C++ include.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

^^^ exactly that.

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [2879811]: BUILD PASSED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [2881094]: BUILD STARTED

mzient and others added 5 commits August 31, 2021 17:12
Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
Signed-off-by: Michał Zientkiewicz <mzient@gmail.com>
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [2882032]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [2881094]: BUILD PASSED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [2882032]: BUILD PASSED

@mzient mzient merged commit f722661 into NVIDIA:main Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants