acts icon indicating copy to clipboard operation
acts copied to clipboard

refactor: Move MLAmbiguitySolver to Core

Open Corentin-Allaire opened this issue 1 year ago • 3 comments

This PR moves the MLAmbiguitySolver to Core, this will allow us to test it more easily with ATLAS in the future. It also removes the DBScan version of this algorithm as it was shown to be way less effective.

Corentin-Allaire avatar Jun 11 '24 12:06 Corentin-Allaire

📊: Physics performance monitoring for a3555d02246521e2da7d72dc11fe384e458d0a82

Full contents

physmon summary

github-actions[bot] avatar Jun 11 '24 14:06 github-actions[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 47.46%. Comparing base (6b2e205) to head (da5a458). Report is 179 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3272   +/-   ##
=======================================
  Coverage   47.46%   47.46%           
=======================================
  Files         510      510           
  Lines       30198    30198           
  Branches    14639    14639           
=======================================
  Hits        14332    14332           
  Misses       5335     5335           
  Partials    10531    10531           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jun 11 '24 15:06 codecov[bot]

Walkthrough

Enhancements made to performance monitoring scripts and ambiguity resolution algorithms in the ACTS project. The phys_perf_mon.sh script now checks for a specific file to trigger performance comparisons, while the physmon_trackfinding_ttbar_pu200.py script introduces a new machine learning function for ambiguity resolution. New header files define concepts and classes for machine learning-based track finding, and several obsolete configurations have been removed to streamline the codebase. Overall, these changes improve the functionality and clarity of the performance monitoring and ambiguity resolution processes.

Changes

File Change Summary
CI/physmon/phys_perf_mon.sh Added conditional block in trackfinding function to check for performance_finding_ckf_ml_solver.root and execute run_histcmp.
CI/physmon/workflows/physmon_trackfinding_ttbar_pu200.py Introduced addAmbiguityResolutionML function for ML-based ambiguity resolution; updated addAmbiguityResolution to use ckf_tracks. Renamed output files for ML performance metrics.
Core/include/Acts/AmbiguityResolution/AmbiguityNetworkConcept.hpp Added AmbiguityNetworkConcept and DummyTrackContainer type alias.
Core/include/Acts/AmbiguityResolution/AmbiguityResolutionML.hpp Introduced AmbiguityResolutionML class with methods for track hits mapping and ambiguity solving.
Core/include/Acts/TrackFinding/detail/AmbiguityTrackClustering.hpp Updated documentation for clusterDuplicateTracks function.
Examples/Algorithms/TrackFindingML/CMakeLists.txt Removed src/AmbiguityResolutionML.cpp and src/AmbiguityResolutionMLDBScanAlgorithm.cpp from build sources.
Examples/Algorithms/TrackFindingML/include/ActsExamples/TrackFindingML/AmbiguityDBScanClustering.hpp Deleted file containing dbscanTrackClustering function.
Examples/Algorithms/TrackFindingML/include/ActsExamples/TrackFindingML/AmbiguityResolutionML.hpp Deleted file defining AmbiguityResolutionML class.
Examples/Algorithms/TrackFindingML/include/ActsExamples/TrackFindingML/AmbiguityResolutionMLAlgorithm.hpp Updated class to inherit from IAlgorithm and modified Config struct.
Examples/Algorithms/TrackFindingML/include/ActsExamples/TrackFindingML/AmbiguityResolutionMLDBScanAlgorithm.hpp Deleted file defining AmbiguityResolutionMLDBScanAlgorithm class.
Examples/Algorithms/TrackFindingML/include/ActsExamples/TrackFindingML/SeedFilterMLAlgorithm.hpp Updated header inclusions without changing class logic.
Examples/Algorithms/TrackFindingML/src/AmbiguityResolutionML.cpp Deleted implementation of AmbiguityResolutionML class.
Examples/Algorithms/TrackFindingML/src/AmbiguityResolutionMLAlgorithm.cpp Updated constructor and internal logic for AmbiguityResolutionMLAlgorithm.
Examples/Algorithms/TrackFindingML/src/AmbiguityResolutionMLDBScanAlgorithm.cpp Deleted implementation of AmbiguityResolutionMLDBScanAlgorithm.
Examples/Io/Csv/include/ActsExamples/Io/Csv/CsvSpacePointWriter.hpp Corrected class name casing for CsvSpacePointWriter.
Examples/Io/Csv/src/CsvSpacePointWriter.cpp Updated class name and method signatures for consistency.
Examples/Python/python/acts/examples/reconstruction.py Removed AmbiguityResolutionMLDBScanConfig and updated ambiguity resolution functions.
Examples/Python/src/Onnx.cpp Removed AmbiguityResolutionMLDBScanAlgorithm from Python bindings.
Examples/Python/src/Output.cpp Updated CSV writer class naming conventions.
Examples/Scripts/Python/MLAmbiguityResolution/ambiguity_solver_network.py Modified sorting logic in prepareDataSet function.
Plugins/Onnx/include/Acts/Plugins/Onnx/AmbiguityTrackClassifier.hpp Removed solveAmbiguity method from AmbiguityTrackClassifier.
Core/src/TrackFinding/AmbiguityTrackClustering.cpp Changed iteration method in clusterDuplicateTracks to reverse iteration.

Possibly related PRs

  • #3807: Enhances logging capabilities in the GbtsTrackingFilter and SeedFinderGbts classes, which may relate to performance monitoring aspects in the main PR's modifications to the phys_perf_mon.sh script.
  • #3812: This PR introduces enhancements for ambiguity resolution using machine learning, which aligns with the main PR's focus on performance monitoring related to machine learning outputs.
  • #3836: The refactor of the HitSelector class to allow for more precise hit selection could relate to the performance monitoring enhancements in the main PR, as both involve improving data handling and processing.
  • #3907: The changes in this PR to allow measurement setting without extra initialization could be relevant to the main PR's focus on performance metrics, as both involve optimizing processes related to measurements.
  • #3921: The compatibility updates for EDM4hep versions may indirectly relate to the main PR's performance monitoring enhancements, as both involve ensuring that the system can handle various data formats effectively.
  • #3950: The relocation of spline functionality to a more accessible location in the visualization components could relate to the main PR's enhancements in performance monitoring, as both involve improving the usability and functionality of the codebase.

Suggested reviewers

  • paulgessinger
  • andiwand

In the code, changes abound,
Performance metrics now profound.
Ambiguities resolved with care,
Machine learning's magic we share.
Yoda's wisdom guides the way,
In track finding, we shall sway! ✨


📜 Recent review details

Configuration used: CodeRabbit UI Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between dbe4a8134d63079bf0185b71fdfab71b4b0646a9 and a3555d02246521e2da7d72dc11fe384e458d0a82.

📒 Files selected for processing (2)
  • Examples/Python/python/acts/examples/reconstruction.py (4 hunks)
  • Examples/Python/src/Output.cpp (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Examples/Python/src/Output.cpp
🔇 Additional comments (3)
Examples/Python/python/acts/examples/reconstruction.py (3)

1969-1984: Hmm, proper track truth matching configuration, I see.

Correctly configured, the track truth matcher is. Double matching enabled, it has. Proper aliases for track-particle matching, established they are.


1992-1996: Wise configuration of track writers, this is.

The essential parameters for track writing, properly set they are. Summary, states, performance metrics - all in balance, they remain.


Line range hint 2009-2079: Strong with the Force, this ML ambiguity resolution implementation is.

A two-stage approach, implemented it has:

  1. ML-based initial resolution with ONNX model
  2. Greedy resolution for final refinement

Yet, verify the model path we must.

✅ Verification successful

Hmm, verify the ONNX model path, we must not. Optional parameter it is, and dynamic at runtime, it shall be provided.

Track matching configuration, properly implemented it is. Follows the established pattern across the codebase, matching algorithm does. Consistent with other truth matching implementations in:

  • Kalman filter tracking
  • GSF tracking
  • CKF tracking
  • ExaTrkX tracking

Correct and complete, the implementation is. Trust in the Force, we shall.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify ONNX model existence and track matching configuration

# Check if ONNX model path is provided in any configuration files
rg -l "\.onnx" --type yaml --type json

# Verify track matching configuration
rg "TrackTruthMatcher" -A 5

Length of output: 11932


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 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.

coderabbitai[bot] avatar Nov 19 '24 22:11 coderabbitai[bot]

@paulgessinger any idea why Bridge CI / linux_physmon is failing?

CarloVarni avatar Nov 25 '24 20:11 CarloVarni

@CarloVarni Seems like all of the ttbar outputs change over on GitLab. Not quite sure why it would not affect the GitHub run. Maybe we have another non-reproducibility issue? (@andiwand)

I don't see anything in this PR that would explain this.

paulgessinger avatar Nov 26 '24 08:11 paulgessinger

@paulgessinger @CarloVarni It seem the issue with the CI bridge is gone ? Could someone reapprove ?

Corentin-Allaire avatar Nov 29 '24 09:11 Corentin-Allaire

:white_check_mark: Athena integration test results [f57e260aaa32eb68bba3e8b71fa960cb79ab1417]

:white_check_mark: All tests successful

status job report
:green_circle: report_pull_request
:green_circle: run_workflow_tests_run4_mc
:green_circle: run_workflow_tests_run2_mc
:green_circle: run_workflow_tests_run2_data
:green_circle: run_workflow_tests_run3_mc
:green_circle: run_workflow_tests_run3_data
:green_circle: test_ActsDumpGeometryIdentifiers
:green_circle: test_ActsCheckObjectCountsWorkflowHgtd
:green_circle: test_ActsCheckObjectCountsCachedWorkflow
:green_circle: test_ActsCheckObjectCountsWorkflow
:green_circle: test_ActsEFTrackFit
:green_circle: test_ActsPersistifySeeds
:green_circle: test_ActsBenchmarkWithSpot
:green_circle: test_ActsAnalogueClustering
:green_circle: test_ActsWorkflowHeavyIons
:green_circle: test_ActsWorkflowFastTracking
:green_circle: test_ActsWorkflowCached
:green_circle: test_ActsWorkflow
:green_circle: test_ActsValidateAmbiguityResolution
:green_circle: test_ActsValidateResolvedTracks
:green_circle: test_ActsValidateTracks
:green_circle: test_ActsValidateActsCoreSpacePoints
:green_circle: test_ActsValidateActsSpacePoints
:green_circle: test_ActsValidateSeeds
:green_circle: test_ActsValidateOrthogonalSeeds
:green_circle: test_ActsValidateClusters
:green_circle: test_ActsPersistifyEDM
:green_circle: test_ActsGx2fRefitting
:green_circle: test_ActsGSFRefitting
:green_circle: test_ActsKfRefitting
:green_circle: test_ActsExtrapolationAlgTest
:green_circle: test_ActsITkTest

acts-project-service avatar Dec 06 '24 03:12 acts-project-service