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

Fix vectorize_graph bug when replacements were provided for only some outputs of a node #570

Merged
merged 1 commit into from
Jan 7, 2024

Conversation

ricardoV94
Copy link
Member

Description

The provided output could be silently ignored and replaced by the new output of the vectorized node.

Also avoids vectorizing multiple-output nodes when none of the unreplaced outputs are needed.

Related Issue

Checklist

Type of change

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

@ricardoV94 ricardoV94 added bug Something isn't working vectorization labels Jan 4, 2024
@ricardoV94 ricardoV94 changed the title Fix vectorize_graph issue when replacements were provided for some but not all outputs of a multi-output node Fix vectorize_graph issue when replacements were provided only some outputs of a multi-output node Jan 4, 2024
@ricardoV94 ricardoV94 changed the title Fix vectorize_graph issue when replacements were provided only some outputs of a multi-output node Fix vectorize_graph issue when replacements were provided only some outputs of a node Jan 4, 2024
@ricardoV94 ricardoV94 changed the title Fix vectorize_graph issue when replacements were provided only some outputs of a node Fix vectorize_graph bug when replacements were provided only some outputs of a node Jan 4, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jan 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e180927) 80.92% compared to head (77b8389) 80.92%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #570   +/-   ##
=======================================
  Coverage   80.92%   80.92%           
=======================================
  Files         162      162           
  Lines       46524    46526    +2     
  Branches    11375    11376    +1     
=======================================
+ Hits        37648    37650    +2     
  Misses       6653     6653           
  Partials     2223     2223           
Files Coverage Δ
pytensor/graph/basic.py 89.08% <100.00%> (ø)
pytensor/graph/replace.py 85.14% <100.00%> (+0.30%) ⬆️

@ricardoV94 ricardoV94 changed the title Fix vectorize_graph bug when replacements were provided only some outputs of a node Fix vectorize_graph bug when replacements were provided for only some outputs of a node Jan 5, 2024
tests/graph/test_basic.py Outdated Show resolved Hide resolved
tests/graph/test_replace.py Outdated Show resolved Hide resolved
tests/graph/test_basic.py Outdated Show resolved Hide resolved
…utputs of a node

The provided output could be silently ignored and replaced by the new output of the vectorized node.

The changes also avoid vectorizing multiple-output nodes when none of the unreplaced outputs are needed.
Copy link
Contributor

@lucianopaz lucianopaz left a comment

Choose a reason for hiding this comment

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

LGTM

@ricardoV94 ricardoV94 merged commit 0ebc83b into pymc-devs:main Jan 7, 2024
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working vectorization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug in vectorize_graph with multi-output nodes
4 participants