pymc-devs / pymc-devs/pytensor
Tracking odds and ends for the pytorch backend with pymc
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 644
- Forks
- 208
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 16
Description
Description
Some of the bigger issues I came across when doing an integration pass with pymc and pytensor were
- (Trivial) allow pytorch in the config defaults
- Some of the Op implementations (e.g. Elemwise) don't always return a tensor, which although expected when you have multiple outputs, caused some upstream failures when creating initial points.
- The linker would return torch tensors always, but when pymc would attempt to copy any of the results or create a buffer for whatever reason sharing a dtype, we would fail (numpy doesn't know what to do with
torch.float) - Lots of graph breaks due to pytorch not liking how we do code generation (that is why the code is littered with
torch.compiler.disable).
I'll post a more detailed torch analysis in a comment for 4.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by separating the four areas listed in the description: config defaults, Op implementations such as Elemwise, linker tensor and dtype handling, and PyTorch code generation. Use the PyMC/PyTensor integration pass as the validation point; done means the listed initial-point, copying, buffer, and graph-break failures no longer occur.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- backend, machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100