pymc-devs / pymc-devs/pytensor

Implement generalized rewrite to replace ops that compute partial outputs by ops with all the outputs

Open
#1,312 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

graph rewriting Op implementation
Dominant language
Python
Stars
644
Forks
208
Avg merge
2d 14h
Merged PRs (30d)
16

Description

Description

Several linalg methods like SVD and QR allow to only request a subset of the outputs.

If we have multiple of these with the same input and different output subsets we should use the one that computes the whole subset once. Also, in the gradient we usually need all the outputs anyway.

It's perhaps easier if we ignore the user request and the user-facing function always uses the Op with all the outputs (not returning the ones not requested by the user). In the specialize rewrite we can specialize into the smaller subset Op. By this time gradients should already have been requested.

We can make the gradient raise if called on an Op which is not computing all the outputs and thus simplify the grad method as well.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests; start by locating the SVD and QR operations and the specialize rewrite entry point. Trace how multiple partial-output operations and gradients are handled, then verify that the user-facing operation computes all outputs while specialization can select a smaller subset.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.