LLNL / MuyGPyS

A fast, pure python implementation of the MuyGPs Gaussian process realization and training algorithm.
Other
25 stars 11 forks source link

Feature/torch test bed #87

Closed alecmdunton closed 1 year ago

alecmdunton commented 1 year ago

Reorganized fast regression tests and added coverage for torch features. Need to add READMEs still.

bwpriest commented 1 year ago

We also need to add tests/precompute/fast_regressor.py to the CI harness. If it is fast, you can just add it to the "short" task.

alecmdunton commented 1 year ago

I know how to fix the docs-building issue.

alecmdunton commented 1 year ago

I know how to fix the docs-building issue.

I might actually need some help here.

bwpriest commented 1 year ago

I know how to fix the docs-building issue.

I might actually need some help here.

I believe that this is happening because you have not added torch to the build environment when you are running the docs build task. In the lines below, we are installing MuyGPyS with the '"docs"` extras flag, but not actually installing torch anywhere. Thus, when the torch notebook gets run, it barfs when it tries to import torch.

https://github.com/alecmdunton/MuyGPyS/blob/14dbcc5de9ea23e06df08525314bd6129259020b/.github/workflows/develop-test.yml#L128-L131

Moreover, you are still using the old interface for MuyGPyS.config in the early cells of the notebook. Note that manipulating the muygpys_*_enabled flags is not actually useful, as they are only there to tell the config object what dependencies are installed and which implementations are available. This is a recent change due to PR #75. Instead, we need to modify the MUYGPYS_BACKEND environment variable or the MuyGPyS.config.muygpys_backend (which is tied to MuyGPyS.config.state.backend) settings. We don't want to mess with the environment variable, since we want the other examples to run in numpy mode. Thus, we should add MuyGPyS.config.update("muygpys_backend","torch") to the top of the example notebook, before you import anything from MuyGPyS.

Another thing. The notebook includes references to MuyGPyS._src, but it is intended to be a guide for an end user to follow to learn how to use MuyGPyS in their torch codes. MuyGPyS._src is backend stuff that we want to abstract away from the user. Instead, we should import the appropriate front end API stuff and depend upon the configuration above to deliver us the correct implementations.

Let me know if you have any questions.

alecmdunton commented 1 year ago

PR Ready for Review - new version release should be ready too.

alecmdunton commented 1 year ago

Addressed all comments and tests are passing.