pymc-devs / pymc-devs/pytensor

Add first-class python backend

Open
#2,193 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backend compatibility help wanted
Dominant language
Python
Stars
644
Forks
208
Avg merge
2d 14h
Merged PRs (30d)
16

Description

We've talked about this before so I just want an issue to track it. The idea is that:

  • perform should be in python, but it should be as simple as possible
  • mode = 'py' should have python-specific dispatches where we can put mode full-featured "performance" python code. An example would be the QZ Op. All that should be moved out of perform, perform should just do scipy.linalg.qz
  • Replace the default FAST_COMPILE with python mode (no compile is really fast right?)

There might not actually be much to do to get this off the ground, just some refactor to make things nice and hide complexity in certain cases. Not sure about how this would impact random variables, scan, etc.

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

Start by tracing the perform entry point, mode = 'py' dispatches, and the default FAST_COMPILE behavior. Review the QZ Op and assess the stated effects on random variables and scan; done should mean the scope and boundaries of the Python backend are agreed and its behavior is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.