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

CMAKE_CUDA_ARCHITECTURES doesn't change when build-system invokes cmake #7579

Merged

Conversation

robertmaynard
Copy link
Contributor

Consider the following:

cmake -DCMAKE_CUDA_ARCHITECTURES="" . #build for detected
touch <cudf_dir>/cpp/CMakeLists.txt
ninja #should be build for detected

cmake -DCMAKE_CUDA_ARCHITECTURES= . #build for all
touch <cudf_dir>/cpp/CMakeLists.txt
ninja #should be build for all

cmake -DCMAKE_CUDA_ARCHITECTURES="" . #build for detected
touch <cudf_dir>/cpp/CMakeLists.txt
ninja #should be build for detected

Before these changes the invocations of ninja would always
go back to building for all when ever ninja was invoked. The issue
is that once a CMake cache variable exists it can't be removed
via -DCMAKE_CUDA_ARCHITECTURES= and therefore becomes sticky.

To resolve the issue you can now pass -DCMAKE_CUDA_ARCHITECTURES=ALL
to consistently get all archs, and now the build-system should not
change what CUDA archs you are building for.

Consider the following:
```
cmake -DCMAKE_CUDA_ARCHITECTURES="" . #build for detected
touch <cudf_dir>/cpp/CMakeLists.txt
ninja #should be build for detected

cmake -DCMAKE_CUDA_ARCHITECTURES= . #build for all
touch <cudf_dir>/cpp/CMakeLists.txt
ninja #should be build for all

cmake -DCMAKE_CUDA_ARCHITECTURES="" . #build for detected
touch <cudf_dir>/cpp/CMakeLists.txt
ninja #should be build for detected
```

Before these changes the invocations of `ninja` would always
go back to building for all when ever `ninja` was invoked. The issue
is that once a CMake cache variable exists it can't be removed
via `-DCMAKE_CUDA_ARCHITECTURES=` and therefore becomes sticky.

To resolve the issue you can now pass `-DCMAKE_CUDA_ARCHITECTURES=ALL`
to consistently get all archs, and now the build-system should not
change what CUDA archs you are building for.
@robertmaynard robertmaynard requested a review from a team as a code owner March 12, 2021 16:13
@github-actions github-actions bot added CMake CMake build issue libcudf Affects libcudf (C++/CUDA) code. labels Mar 12, 2021
@kkraus14 kkraus14 added bug Something isn't working non-breaking Non-breaking change labels Mar 12, 2021
@kkraus14
Copy link
Collaborator

@gpucibot merge

@robertmaynard
Copy link
Contributor Author

rerun tests

@robertmaynard
Copy link
Contributor Author

ImportError: cannot import name 'stringify_path' from 'dask.bytes.core'

Anything I can do to resolve that issue from CI?

@kkraus14
Copy link
Collaborator

ImportError: cannot import name 'stringify_path' from 'dask.bytes.core'

Anything I can do to resolve that issue from CI?

Will be fixed in #7580

@kkraus14
Copy link
Collaborator

rerun tests

@codecov
Copy link

codecov bot commented Mar 13, 2021

Codecov Report

Merging #7579 (b67420d) into branch-0.19 (7871e7a) will increase coverage by 0.12%.
The diff coverage is 93.22%.

Impacted file tree graph

@@               Coverage Diff               @@
##           branch-0.19    #7579      +/-   ##
===============================================
+ Coverage        81.86%   81.99%   +0.12%     
===============================================
  Files              101      101              
  Lines            16884    16989     +105     
===============================================
+ Hits             13822    13930     +108     
+ Misses            3062     3059       -3     
Impacted Files Coverage Δ
python/cudf/cudf/core/index.py 92.86% <ø> (ø)
python/cudf/cudf/core/column/column.py 87.73% <83.33%> (-0.03%) ⬇️
python/cudf/cudf/core/column/numerical.py 94.85% <85.71%> (-0.17%) ⬇️
python/cudf/cudf/core/frame.py 89.02% <89.47%> (+<0.01%) ⬆️
python/cudf/cudf/core/column/decimal.py 92.75% <90.32%> (-2.12%) ⬇️
python/cudf/cudf/core/dataframe.py 90.45% <95.00%> (-0.01%) ⬇️
python/cudf/cudf/core/series.py 91.24% <95.55%> (+0.46%) ⬆️
python/cudf/cudf/core/column/string.py 86.55% <100.00%> (+0.05%) ⬆️
python/cudf/cudf/core/column_accessor.py 95.28% <100.00%> (-0.03%) ⬇️
python/cudf/cudf/core/dtypes.py 90.27% <100.00%> (+0.54%) ⬆️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eaec3db...c6a4ec6. Read the comment docs.

@rapids-bot rapids-bot bot merged commit 396f741 into rapidsai:branch-0.19 Mar 13, 2021
trxcllnt added a commit to trxcllnt/node-rapids that referenced this pull request Mar 13, 2021
robertmaynard added a commit to trxcllnt/cudf that referenced this pull request Mar 15, 2021
@robertmaynard robertmaynard deleted the cudf_consistent_cuda_archs branch March 15, 2021 19:54
rapids-bot bot pushed a commit that referenced this pull request Mar 15, 2021
Fixes regression from #7579 in auto-detecting GPU architectures when `-DCMAKE_CUDA_ARCHITECTURES=` is passed on the CLI.

Now that the cached `CMAKE_CUDA_ARCHITECTURES` isn't unset before calling `enable_language(CUDA)`, this call throws an error and configuration fails. This change ensures we call `enable_language(CUDA)` after any potential rewrites of `CMAKE_CUDA_ARCHITECTURES`.

This PR also aligns with RMM's `EvalGPUArchs.cmake` logic and prints `SUPPORTED_CUDA_ARCHITECTURES` instead of `"ALL"` in the case the current machine is a CPU-only node.

Related: rapidsai/rmm#727

Authors:
  - Paul Taylor (@trxcllnt)
  - Robert Maynard (@robertmaynard)

Approvers:
  - Keith Kraus (@kkraus14)

URL: #7593
hyperbolic2346 pushed a commit to hyperbolic2346/cudf that referenced this pull request Mar 25, 2021
…ke (rapidsai#7579)

Consider the following:
```
cmake -DCMAKE_CUDA_ARCHITECTURES="" . #build for detected
touch <cudf_dir>/cpp/CMakeLists.txt
ninja #should be build for detected

cmake -DCMAKE_CUDA_ARCHITECTURES= . #build for all
touch <cudf_dir>/cpp/CMakeLists.txt
ninja #should be build for all

cmake -DCMAKE_CUDA_ARCHITECTURES="" . #build for detected
touch <cudf_dir>/cpp/CMakeLists.txt
ninja #should be build for detected
```

Before these changes the invocations of `ninja` would always
go back to building for all when ever `ninja` was invoked. The issue
is that once a CMake cache variable exists it can't be removed
via `-DCMAKE_CUDA_ARCHITECTURES=` and therefore becomes sticky.

To resolve the issue you can now pass `-DCMAKE_CUDA_ARCHITECTURES=ALL`
to consistently get all archs, and now the build-system should not
change what CUDA archs you are building for.

Authors:
  - Robert Maynard (@robertmaynard)

Approvers:
  - Keith Kraus (@kkraus14)

URL: rapidsai#7579
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CMake CMake build issue libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants