Skip to content

Lift assumptions into scan inner function#2172

Draft
jessegrabowski wants to merge 4 commits into
pymc-devs:mainfrom
jessegrabowski:scan-lift-assumptions
Draft

Lift assumptions into scan inner function#2172
jessegrabowski wants to merge 4 commits into
pymc-devs:mainfrom
jessegrabowski:scan-lift-assumptions

Conversation

@jessegrabowski
Copy link
Copy Markdown
Member

.wip

scan_delegate propagates matrix-property facts through a Scan node
during inference. lift_assumptions_into_scan is a scan_seqopt1 rewrite
that re-asserts a Scan's outer-input assumptions on the inner graph, so
assumption-driven rewrites of the loop body can fire. Wired in via
assumptions/__init__.py.
Copy link
Copy Markdown
Member

@ricardoV94 ricardoV94 left a comment

Choose a reason for hiding this comment

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

look like a great start. Would be nice to look at a grad case where outputs get flipped and become sequences of the grad scan



@node_rewriter([Scan])
def lift_assumptions_into_scan(fgraph, node):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I prefer inline/lower/sink. Lift sounds to me like inside->out.

But into kinda specifies it. Some move...into is perhaps the best

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.

2 participants