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

Fix CMake files in libcudf C++ examples to use existing libcudf build if present #15348

Merged
merged 30 commits into from
Apr 18, 2024

Conversation

mhaseeb123
Copy link
Member

@mhaseeb123 mhaseeb123 commented Mar 20, 2024

Description

This PR fixes the CMake artifacts for libcudf examples and includes CI updates to create executable libcudf-example conda package to run from CI

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@mhaseeb123 mhaseeb123 requested review from a team as code owners March 20, 2024 03:33
Copy link

copy-pr-bot bot commented Mar 20, 2024

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions bot added libcudf Affects libcudf (C++/CUDA) code. CMake CMake build issue labels Mar 20, 2024
@mhaseeb123 mhaseeb123 added 3 - Ready for Review Ready for review by team improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Mar 20, 2024
cpp/examples/build.sh Outdated Show resolved Hide resolved
cpp/examples/build.sh Outdated Show resolved Hide resolved
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.

Great. This is getting closer to what I expect.

Do you think we should also run the binaries from libcudf-example in the C++ tests job in CI?

The steps to do that:

Add libcudf-example to

rapids-mamba-retry install \
--channel "${CPP_CHANNEL}" \
libcudf libcudf_kafka libcudf-tests

Then add a section like this to the test_cpp.sh job that calls a new script called run_cudf_examples.sh. Track the error/exit code.

cudf/ci/test_cpp.sh

Lines 16 to 18 in 79d2dba

rapids-logger "Run libcudf gtests"
./ci/run_cudf_ctests.sh -j20
SUITEERROR=$?

Test that this fails in CI by pushing a change that compiles to an example binary but exits with a nonzero code.

cpp/examples/build.sh Outdated Show resolved Hide resolved
cpp/examples/set_cuda_architecture.cmake Outdated Show resolved Hide resolved
@davidwendt
Copy link
Contributor

Do you think we should also run the binaries from libcudf-example in the C++ tests job in CI?

Just to be clear. This would just run the example to make sure it did not crash?
It would not actually verify the example produces the correct result, right?
I suppose there is value is checking for a crash only.
Perhaps it could run through compute-sanitizer.
This may be out of scope for this PR.

@bdice
Copy link
Contributor

bdice commented Mar 20, 2024

Yes, this is just to verify the example binaries (1) were built, (2) were packaged, and (3) exit 0 / do not crash. It sounds like we had issues with multiple aspects of the examples, not least of which was the build failing silently. The binaries could be run under sanitizers in the other memcheck test script but that is lower priority to me.

@bdice
Copy link
Contributor

bdice commented Mar 20, 2024

We could run the examples in CI in another PR but I don’t want to lose track of this. I’d prefer it in this PR since the changes should be relatively small and are somewhat related to the other build fixes here.

@harrism
Copy link
Member

harrism commented Mar 22, 2024

@mhaseeb123 would you mind making your PR title a little more specific? The title goes in CHANGELOG.md when we release so specific titles help make this file useful.

@mhaseeb123 mhaseeb123 changed the title updates for libcudf examples cmake files Fix examples CMake files to build with exisiting libcudf installation if present and automatically fetch CUDA_ARCHITECTURE Mar 22, 2024
@mhaseeb123 mhaseeb123 changed the title Fix examples CMake files to build with exisiting libcudf installation if present and automatically fetch CUDA_ARCHITECTURE Fix examples CMake files to build with exisiting libcudf installation if present and fetch correct CUDA_ARCHITECTURE Mar 22, 2024
@mhaseeb123 mhaseeb123 changed the title Fix examples CMake files to build with exisiting libcudf installation if present and fetch correct CUDA_ARCHITECTURE Fix examples CMake files to use exisiting libcudf build if present Mar 22, 2024
@mhaseeb123
Copy link
Member Author

@mhaseeb123 would you mind making your PR title a little more specific? The title goes in CHANGELOG.md when we release so specific titles help make this file useful.

Updated the PR title.

@mhaseeb123 mhaseeb123 changed the title Fix examples CMake files to use exisiting libcudf build if present Fix CMake files in libcudf C++ examples to use exisiting libcudf build if present Mar 22, 2024
@bdice bdice changed the title Fix CMake files in libcudf C++ examples to use exisiting libcudf build if present Fix CMake files in libcudf C++ examples to use existing libcudf build if present Mar 22, 2024
@mhaseeb123 mhaseeb123 requested a review from a team as a code owner March 22, 2024 22:21
@github-actions github-actions bot added the ci label Mar 22, 2024
@mhaseeb123
Copy link
Member Author

/ok to test

@mhaseeb123 mhaseeb123 added 3 - Ready for Review Ready for review by team and removed 2 - In Progress Currently a work in progress labels Apr 16, 2024
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.

Nice. This is vastly improved. I have a few comments, but we're getting closer.

cpp/examples/basic/CMakeLists.txt Outdated Show resolved Hide resolved
cpp/examples/build.sh Outdated Show resolved Hide resolved
cpp/examples/fetch_dependencies.cmake Outdated Show resolved Hide resolved
@mhaseeb123
Copy link
Member Author

/ok to test

@mhaseeb123
Copy link
Member Author

mhaseeb123 commented Apr 17, 2024

Weird CI build failure. Retriggering run.

cpp/examples/strings/CMakeLists.txt Outdated Show resolved Hide resolved
cpp/examples/strings/CMakeLists.txt Outdated Show resolved Hide resolved
@mhaseeb123
Copy link
Member Author

/ok to test

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.

This seems fine to me. I think it'd be good to get approval from @robertmaynard / @KyleFromNVIDIA / @davidwendt since they all requested changes.

@mhaseeb123
Copy link
Member Author

/merge

@mhaseeb123 mhaseeb123 dismissed stale reviews from KyleFromNVIDIA and davidwendt April 18, 2024 19:47

All changes incorporated. Thank you!

@rapids-bot rapids-bot bot merged commit b8d003e into rapidsai:branch-24.06 Apr 18, 2024
75 checks passed
@mhaseeb123
Copy link
Member Author

/merge

@mhaseeb123 mhaseeb123 deleted the cudf-examples-cmake-fix branch April 18, 2024 19:48
rapids-bot bot pushed a commit that referenced this pull request May 13, 2024
This PR adds a new example `parquet_io` to `libcudf/cpp/examples` instrumenting reading and writing parquet files with different column encodings (same for all columns for now) and compressions to close #15344. The example maybe elaborated and/or evolved as needed. #15348 should be merged before this PR to get all CMake updates needed to successfully build and run this example.

Authors:
  - Muhammad Haseeb (https://github.com/mhaseeb123)

Approvers:
  - Vukasin Milovanovic (https://github.com/vuule)
  - Ray Douglass (https://github.com/raydouglass)

URL: #15420
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 CMake CMake build issue improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants