Skip to content

Rewrite solve(matrix_inverse(X), b) → X @ b#2114

Merged
ricardoV94 merged 1 commit into
pymc-devs:mainfrom
alessandrogentili001:rewrite-solve-matrix-inverse-as-mutmul-updated
May 5, 2026
Merged

Rewrite solve(matrix_inverse(X), b) → X @ b#2114
ricardoV94 merged 1 commit into
pymc-devs:mainfrom
alessandrogentili001:rewrite-solve-matrix-inverse-as-mutmul-updated

Conversation

@alessandrogentili001
Copy link
Copy Markdown
Contributor

Description

Opened a new PR and closed the previous one after getting troubles with git (my fault). By the way.

Update: Refactored Structural Testing

I have updated the PR to address the recent feedback regarding the test suite.

Key Changes:

  • Idiomatic Rewrite Invocation: Switched from a custom WalkingGraphRewriter to the standard rewrite_graph(include=["stabilize"]) pattern.
  • Structural Verification: Replaced numerical checks with assert_equal_computations. Both the rewritten graph and the expected X @ b graph are stabilized to ensure a common structural baseline (handling the internal lowering of Matmul to BLAS ops like Dot).
  • Cleaned Up Tests: Removed manual loops and numerical validation as suggested, keeping the test suite performant and focused on the rewrite logic.

The implementation is verified to pass all tests and adheres to the latest repository linting standards.

Related Issue

Checklist

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

@ricardoV94
Copy link
Copy Markdown
Member

Opened a new PR and closed the previous one after getting troubles with git (my fault). By the way.

You could have force-push to your old branch once you fixed it locally.

@ricardoV94 ricardoV94 merged commit bd4ad92 into pymc-devs:main May 5, 2026
66 checks passed
@ricardoV94
Copy link
Copy Markdown
Member

Thanks @alessandrogentili001!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rewrite solve(matrix_inverse(X), b) → X @ b

2 participants