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

Speedup pytensor import #1170

Merged

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Jan 23, 2025

Smaller scope changes from #1161

Before:

1.2942 root       pytensor                                
0.9677 project    pytensor.scalar                         
0.7629 project    pytensor.scalar.math                    
0.5800 dependency scipy.stats                             
0.4957 transitive scipy.stats._stats_py                    from scipy.stats
0.2706 transitive scipy.stats.distributions                from scipy.stats._stats_py
0.2090 transitive scipy.stats._continuous_distns           from scipy.stats.distributions
0.2042 project    pytensor.scalar.basic                   
0.1879 project    pytensor.printing                       
0.1587 dependency scipy.special                           
0.1301 project    pytensor.compile                        
0.1294 project    pytensor.compile.function               
0.1216 project    pytensor.configdefaults                 
0.1187 project    pytensor.compile.mode                   
0.1165 transitive scipy.special._orthogonal                from scipy.special
0.1154 transitive scipy.linalg                             from scipy.special._orthogonal
0.1153 project    pytensor.link.c.basic                   
0.1138 project    pytensor.tensor                         
0.1049 dependency numpy                                   
0.0962 project    pytensor.tensor.rewriting               
0.0938 transitive scipy.optimize                           from scipy.stats._stats_py
0.0826 project    pytensor.link.c.cmodule                 
0.0775 dependency setuptools                              
0.0656 transitive scipy.linalg._sketches                   from scipy.linalg
0.0647 transitive scipy.spatial                            from scipy.stats._stats_py

After:

0.9409 root       pytensor                                
0.6329 project    pytensor.scalar                         
0.6079 project    pytensor.scalar.math                    
0.4996 dependency scipy.stats                             
0.4185 transitive scipy.stats._stats_py                    from scipy.stats
0.2383 transitive scipy.stats.distributions                from scipy.stats._stats_py
0.1771 transitive scipy.stats._continuous_distns           from scipy.stats.distributions
0.1223 project    pytensor.configdefaults                 
0.1181 project    pytensor.tensor                         
0.1077 dependency numpy                                   
0.1003 project    pytensor.tensor.rewriting               
0.0889 dependency scipy.special                           
0.0855 transitive scipy.optimize                           from scipy.stats._stats_py
0.0613 transitive scipy.special._orthogonal                from scipy.special
0.0606 transitive scipy.linalg                             from scipy.special._orthogonal
0.0408 transitive numpy.__config__                         from numpy
0.0402 transitive numpy.core                               from numpy.__config__
0.0400 transitive scipy.linalg._sketches                   from scipy.linalg
0.0391 transitive scipy.sparse                             from scipy.linalg._sketches
0.0368 project    pytensor.tensor.rewriting.math          
0.0337 project    pytensor.tensor.rewriting.basic         
0.0327 transitive scipy.optimize._linprog                  from scipy.optimize
0.0279 transitive numpy.lib                                from numpy
0.0269 transitive scipy.stats._discrete_distns             from scipy.stats.distributions
0.0267 transitive scipy.stats._distn_infrastructure        from scipy.stats.distributions

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

@Armavica
Copy link
Member

I gather it is the same just without the scipy changes?

@ricardoV94
Copy link
Member Author

I gather it is the same just without the scipy changes?

yup

Copy link

codecov bot commented Jan 23, 2025

Codecov Report

Attention: Patch coverage is 50.79365% with 31 lines in your changes missing coverage. Please review.

Project coverage is 82.27%. Comparing base (a0fe30d) to head (5038dc7).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
pytensor/printing.py 42.30% 14 Missing and 1 partial ⚠️
pytensor/tensor/blas.py 0.00% 8 Missing and 1 partial ⚠️
pytensor/d3viz/formatting.py 25.00% 3 Missing ⚠️
pytensor/graph/rewriting/basic.py 0.00% 2 Missing ⚠️
pytensor/link/c/cmodule.py 66.66% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1170      +/-   ##
==========================================
+ Coverage   82.11%   82.27%   +0.15%     
==========================================
  Files         186      186              
  Lines       48201    48004     -197     
  Branches     8679     8624      -55     
==========================================
- Hits        39579    39493      -86     
+ Misses       6447     6352      -95     
+ Partials     2175     2159      -16     
Files with missing lines Coverage Δ
pytensor/compile/compilelock.py 97.22% <100.00%> (+0.07%) ⬆️
pytensor/configdefaults.py 73.46% <100.00%> (-0.09%) ⬇️
pytensor/configparser.py 92.53% <100.00%> (ø)
pytensor/link/vm.py 92.39% <100.00%> (ø)
pytensor/scan/op.py 84.69% <100.00%> (ø)
pytensor/tensor/blas_scipy.py 88.23% <100.00%> (+3.23%) ⬆️
pytensor/tensor/rewriting/blas_scipy.py 87.50% <100.00%> (+5.14%) ⬆️
pytensor/graph/rewriting/basic.py 70.31% <0.00%> (-0.12%) ⬇️
pytensor/link/c/cmodule.py 60.84% <66.66%> (+0.44%) ⬆️
pytensor/d3viz/formatting.py 10.99% <25.00%> (-1.90%) ⬇️
... and 2 more

... and 1 file with indirect coverage changes

@ricardoV94 ricardoV94 merged commit 450efff into pymc-devs:main Jan 23, 2025
63 of 65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants