Skip to content

Conversation

@gdalle
Copy link
Owner

@gdalle gdalle commented Oct 8, 2025

Fixes #67

Context

At the moment, DI can only use algorithms from SMC, but people might want to code other coloring algorithms following the ADTypes interface, for instance our friend @SouthEndMusic who was interested in provably optimal colorings. During decompression, we will still need SMC result types, but those are deeply tied to the coloring algorithm itself (for star and acyclic colorings + their bidirectional counterparts). How do we create SMC results from a generic algorithm which outputs only a vector of colors?

Idea

Pretend we run the greedy algorithm, but force the color choices and piggyback on the rest of the procedure for constructing data structures like the StarSet and TreeSet. This enables maximum code reuse, even though it may not be optimal from a performance standpoint.
As a side bonus, this also allows us to assert correctness of the provided colorings, because our greedy procedure enforces it.

Todo

  • Test on a non-trivial coloring algorithm (not just ADTypes.NoColoringAlgorithm) => done with OptimalColoringAlgorithm based on a JuMP formulation, but removed from the current PR
  • Solve Add more coloring options -- bicoloring SciML/ADTypes.jl#69 and then integrate that
  • Figure out whether we can accept zero (unused) colors in the output of ADTypes.symmetric_coloring or ADTypes.bidirectional_coloring

@gdalle gdalle requested a review from amontoison October 8, 2025 12:56
@codecov
Copy link

codecov bot commented Oct 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (e77226a) to head (e4dd8c1).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #263   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines         1955      1962    +7     
=========================================
+ Hits          1955      1962    +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@amontoison amontoison added the feature New feature or extension label Oct 8, 2025
@gdalle gdalle marked this pull request as ready for review October 10, 2025 08:20
@amontoison
Copy link
Collaborator

The diff is quite big, it will be hard to review it soon.
Can you ping me when it is ready?

@gdalle
Copy link
Owner Author

gdalle commented Oct 13, 2025

@amontoison I removed the OptimalColoringAlgorithm part to simplify, this is ready to go

@gdalle
Copy link
Owner Author

gdalle commented Oct 20, 2025

Gentle bump @amontoison, this one is ready for you while #267 marinates.

PS: I deactivated the formatting test because it passes locally and I can't figure out what's wrong. More generally, JuliaFormatter seems less and less reliable, so I'll soon switch to Runic anyway.

@amontoison
Copy link
Collaborator

I will have a look today. I got a visitor last week at ANL that stayed at home. I should be less busy this week!

@gdalle
Copy link
Owner Author

gdalle commented Oct 20, 2025

Also it seems the GPU tests are failing for unrelated reasons

@amontoison
Copy link
Collaborator

Also it seems the GPU tests are failing for unrelated reasons

We ordered a new SSD for Moonshot, it is the issue.

@amontoison
Copy link
Collaborator

All tests passed, you can merge it when it is good for you 👍

@gdalle gdalle merged commit b53dbf9 into main Oct 22, 2025
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decompression from vector of colors?

2 participants