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

refactor: Remove cugraph, refactor GNN plugin cmake #4014

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

benjaminhuth
Copy link
Member

@benjaminhuth benjaminhuth commented Jan 9, 2025

Removes cuda because it is not tested and a very heavy dependency
Refactors the exatrkx cmake code

--- END COMMIT MESSAGE ---

Any further description goes here, @-mentions are ok here!

  • Use a conventional commits prefix: quick summary
    • We mostly use feat, fix, refactor, docs, chore and build types.
  • A milestone will be assigned by one of the maintainers

Summary by CodeRabbit

Release Notes

  • Removed Dependencies

    • Removed cugraph library dependency from Exa.TrkX plugin
  • Build Configuration

    • Updated CMake configuration for Exa.TrkX plugin
    • Upgraded CUDA standard from version 17 to 20
    • Simplified source file management
  • Track Finding

    • Replaced CuGraph track building with alternative implementation
    • Updated Python bindings to remove CuGraph-specific track building method
  • Documentation

    • Updated getting started guide to reflect removed dependencies

@benjaminhuth benjaminhuth added this to the next milestone Jan 9, 2025
Copy link

coderabbitai bot commented Jan 9, 2025

Walkthrough

Significant changes, this pull request brings. Dependencies related to CuGraph, removed they are, simplifying the Exa.TrkX plugin's track building process. Across multiple files, modifications span, including CMakeLists.txt configurations, Python bindings, and source files. The shift from CuGraph to BoostTrackBuilding, a notable change it is.

Changes

File Change Summary
CMakeLists.txt Removed conditional block for ACTS_EXATRKX_ENABLE_ONNX and cugraph package
Examples/Python/python/acts/examples/reconstruction.py Replaced CugraphTrackBuilding with BoostTrackBuilding
Examples/Python/src/ExaTrkXTrackFinding.cpp Removed CugraphTrackBuilding header and class registration
Plugins/ExaTrkX/CMakeLists.txt Restructured library configuration, updated CUDA settings, removed cugraph dependencies
Plugins/ExaTrkX/README.md Removed cugraph dependency information
Removed Files CugraphTrackBuilding.hpp, CugraphTrackBuilding.cpp, weaklyConnectedComponentsCugraph.hpp
docs/getting_started.md Removed cugraph dependency from prerequisites

Possibly related PRs

Suggested Labels

Component - Fatras, automerge

Suggested Reviewers

  • asalzburger

Poem

Tracks once bound by CuGraph's might,
Now dance with Boost's simpler light 🚀
Dependencies shed like autumn leaves,
Code flows free, the system breathes.
Simplicity wins the coding fight! 🌟


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8df2924 and 76b6b13.

📒 Files selected for processing (1)
  • Plugins/ExaTrkX/CMakeLists.txt (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: macos
🔇 Additional comments (6)
Plugins/ExaTrkX/CMakeLists.txt (6)

1-1: Verify duplicate library definition removal, we must!

Hmmmm. Previous review noticed duplicate add_library commands, it did. Confirm that only one definition remains, we should.

#!/bin/bash
# Search for duplicate add_library commands for ActsPluginExaTrkX
rg "add_library.*ActsPluginExaTrkX" -A 1

3-5: Good, this CUDA configuration is!

Clear and proper handling of CUDA compilation flags, I see. Wise decision to use conditional compilation, it is.


8-11: Improved modularity with target_sources, I sense!

Wise choice to use target_sources for ONNX files, it is. Clean separation of concerns, this brings. Removal of cugraph dependency, accomplished it is.


15-23: Strong with the Force, this change is!

Replaced cugraph with BoostTrackBuilding, you have. Modern CMake practices with target_sources, you follow. Hmmmm, good this is!


72-72: Clean dependency removal, this is!

Removed cugraph from link libraries, you have. Simple and focused the dependencies now are.


47-57: Verify CUDA 20 compatibility, we must!

Updated CUDA standard to 20, you have. Wise to add debugging flags, it is. But verify minimum CUDA toolkit version requirements, we should.

Run this command to check CUDA compatibility:

✅ Verification successful

Safe to use CUDA 20, it is!

Properly configured, the CUDA settings are. Debug symbols and line info, wisely added they were. No compatibility issues, I sense.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for minimum CUDA version requirements in the codebase
rg "cmake_minimum_required|find_package.*CUDA" -A 2

Length of output: 924


Script:

#!/bin/bash
# Search for enable_cuda function and CUDA configuration
fd -e cmake -x cat {} \; | rg "function.*enable_cuda|CUDA_(COMPILER|ARCH|VERSION)"

# Search for any CUDA-related compiler requirements
rg "CUDA" -g "*.cmake" -A 2

Length of output: 115


Script:

#!/bin/bash
# Find any cuda-related files
fd cuda

# Check cmake directory specifically for CUDA settings
fd . cmake -t f -x cat {} \;

# Look for compiler requirements in build files
rg -g "CMakeLists.txt" "CUDA|cuda" -A 3

Length of output: 67723

Finishing Touches

  • 📝 Generate Docstrings

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added Component - Examples Affects the Examples module Component - Plugins Affects one or more Plugins Component - Documentation Affects the documentation labels Jan 9, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
Examples/Python/python/acts/examples/reconstruction.py (1)

1801-1801: Wise choice, replacing CugraphTrackBuilding with BoostTrackBuilding is!

Align with PR objectives, this change does. Remove heavy cugraph dependency while maintaining track building functionality, it does.

Consider documenting performance characteristics of BoostTrackBuilding compared to previous implementation, we should. Help future maintainers understand trade-offs, it would.

Plugins/ExaTrkX/CMakeLists.txt (1)

Line range hint 82-89: Document the linker flag in more detail, we should!

Good that explained the need for -no-as-needed flag, you have. But enhance the documentation further, we could. Specific scatter operations required and potential implications, mention we should.

Add more detailed comment:

-    # Should not discard TorchScatter even if its not needed at this point
-    # since we need the scatter_max operation in the torch script later
+    # Prevent discarding of TorchScatter library even when not directly referenced
+    # Required for:
+    # - scatter_max operation in torch script
+    # - future scatter operations in graph neural networks
+    # Note: This may increase runtime dependencies
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 567db0c and 8df2924.

📒 Files selected for processing (9)
  • CMakeLists.txt (0 hunks)
  • Examples/Python/python/acts/examples/reconstruction.py (1 hunks)
  • Examples/Python/src/ExaTrkXTrackFinding.cpp (0 hunks)
  • Plugins/ExaTrkX/CMakeLists.txt (3 hunks)
  • Plugins/ExaTrkX/README.md (0 hunks)
  • Plugins/ExaTrkX/include/Acts/Plugins/ExaTrkX/CugraphTrackBuilding.hpp (0 hunks)
  • Plugins/ExaTrkX/src/CugraphTrackBuilding.cpp (0 hunks)
  • Plugins/ExaTrkX/src/weaklyConnectedComponentsCugraph.hpp (0 hunks)
  • docs/getting_started.md (0 hunks)
💤 Files with no reviewable changes (7)
  • Plugins/ExaTrkX/README.md
  • Plugins/ExaTrkX/include/Acts/Plugins/ExaTrkX/CugraphTrackBuilding.hpp
  • docs/getting_started.md
  • Plugins/ExaTrkX/src/weaklyConnectedComponentsCugraph.hpp
  • Examples/Python/src/ExaTrkXTrackFinding.cpp
  • CMakeLists.txt
  • Plugins/ExaTrkX/src/CugraphTrackBuilding.cpp
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: merge-sentinel
  • GitHub Check: lint
  • GitHub Check: build_debug
  • GitHub Check: docs
🔇 Additional comments (4)
Examples/Python/python/acts/examples/reconstruction.py (1)

Line range hint 1780-1801: Consistent track builder implementation across backends, verify we must!

Notice that both Torch and Onnx backends use BoostTrackBuilding now, I do. Good for consistency, this is!

Run this command to confirm no remaining references to CugraphTrackBuilding exist:

✅ Verification successful

Purged completely, CugraphTrackBuilding has been!

Searched the entire codebase with the Force, I have. No trace of CugraphTrackBuilding remains, hmm. Consistent use of BoostTrackBuilding across both backends, there is. Balance to the Force, this brings!

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining references to CugraphTrackBuilding
rg "CugraphTrackBuilding"

Length of output: 25


Script:

#!/bin/bash
# Search for any cugraph-related references case-insensitively
rg -i "cugraph"

# Also search specifically in Python files and config files
find . -type f \( -name "*.py" -o -name "*.json" -o -name "*.yaml" -o -name "*.yml" \) -exec grep -i "cugraph" {} \;

Length of output: 137

Plugins/ExaTrkX/CMakeLists.txt (3)

8-22: Organized well, the source files are!

Pleased with the clean separation of ONNX and Torch sources using target_sources, I am. Clear organization by feature, this brings. Strong with the Force, this code structure is!


74-74: Successfully removed cugraph dependency, you have!

Clean and simple, the ONNX configuration now is. Removed the cugraph dependency as planned, we have. Private linking of OnnxRuntime, sufficient it is!


49-59: Verify CUDA 20 compatibility with all dependencies, we must!

Updated to CUDA standard 20, I see. Wise decision it may be, but verify compatibility with all dependencies and target platforms, we must.

Run this command to check CUDA toolkit version requirements:

Plugins/ExaTrkX/CMakeLists.txt Show resolved Hide resolved
Copy link

github-actions bot commented Jan 9, 2025

📊: Physics performance monitoring for 6b6cb07

Full contents

physmon summary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Component - Documentation Affects the documentation Component - Examples Affects the Examples module Component - Plugins Affects one or more Plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants