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

Torch dispatch for scipy-like functions and Softplus #1066

Merged
merged 5 commits into from
Nov 27, 2024

Conversation

Ch0ronomato
Copy link
Contributor

@Ch0ronomato Ch0ronomato commented Nov 2, 2024

Description

I was goofing around with pymc using the pytorch backend. I implemented a beta binomial model and had an issue when supporting some scipy methods, and was missing softplus. I wrote some small shims. Let me know your thoughts on the importlib stuff.

Related Issue

Checklist

Type of change

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

📚 Documentation preview 📚: https://pytensor--1066.org.readthedocs.build/en/1066/

@Ch0ronomato
Copy link
Contributor Author

I'm okay with closing this, just want to get your thoughts on it in relation to #1065

Copy link

codecov bot commented Nov 2, 2024

Codecov Report

Attention: Patch coverage is 86.36364% with 3 lines in your changes missing coverage. Please review.

Project coverage is 82.12%. Comparing base (ae66e82) to head (7fec045).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pytensor/link/pytorch/dispatch/elemwise.py 72.72% 2 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1066   +/-   ##
=======================================
  Coverage   82.12%   82.12%           
=======================================
  Files         183      183           
  Lines       48016    48035   +19     
  Branches     8648     8650    +2     
=======================================
+ Hits        39433    39450   +17     
- Misses       6417     6418    +1     
- Partials     2166     2167    +1     
Files with missing lines Coverage Δ
pytensor/link/pytorch/dispatch/scalar.py 71.87% <100.00%> (+11.00%) ⬆️
pytensor/link/pytorch/dispatch/elemwise.py 66.66% <72.72%> (+1.28%) ⬆️

@ricardoV94
Copy link
Member

ricardoV94 commented Nov 2, 2024

I'm okay with closing this, just want to get your thoughts on it in relation to #1065

This looks fine why did you ask about closing it?

Can you add some small tests for one of the scipy ops and the softplus?

@ricardoV94 ricardoV94 changed the title Adds Scipy module stuff and softplus Torch dispatch for scipy-like functions and Softplus Nov 5, 2024
@ricardoV94 ricardoV94 added enhancement New feature or request torch PyTorch backend labels Nov 5, 2024
Copy link
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.

Looks great, just a nit in the tests

@ricardoV94
Copy link
Member

@Ch0ronomato can you fix the conflicts, should be simple

@ricardoV94 ricardoV94 merged commit c477732 into pymc-devs:main Nov 27, 2024
60 of 62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request torch PyTorch backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants