Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

Fixes a timeout issue in message_passing_fast when handling a large number of cliques (e.g. 26) by switching einsum optimization strategy from "dp" to "greedy" when the number of factors is greater than 10. This prevents excessive compilation times caused by exhaustive path search in einsum.


PR created automatically by Jules for task 5768627831529016600 started by @ryan112358

The `message_passing_fast` function was timing out during JAX compilation
when `einsum` was called with a large number of operands (e.g., > 20).
This was due to the default `optimize="dp"` setting in `sum_product`, which
performs an exhaustive search for the optimal contraction path.

This change switches the optimization strategy to `"greedy"` when the
number of factors exceeds 10, avoiding the compilation hang while still
producing a reasonable contraction path.

Added a regression test `test/test_timeout_fix.py`.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant