gpytorch icon indicating copy to clipboard operation
gpytorch copied to clipboard

[Feature Request] GPytorch C++ API Frontend

Open acxz opened this issue 5 years ago • 2 comments

🚀 Feature Request

So far GP frameworks have only been done on scripting languages like Octave (GPML) and Python (GPy, GPFlow, etc.) It would be amazing to see GPytorch implement a C++ Frontend. While the C++ Frontend may not necessarily be faster than the Python API of GPytorch, having this frontend will allow GPytorch to work with the rest of the existing C++ codebases out there. This is mostly useful for multi threading, low latency, and critical deployment environments. See: https://pytorch.org/tutorials/advanced/cpp_frontend.html#motivation

Motivation

The main reason this is brought about is that working on safety critical systems, we use a lot of C++ in our architecture. Multithreading is also something important since due to Python's GIL, true multithreading/multiprocessing cannot happen. Pytorch has a pretty good C++ frontend, link and lately @jacobrgardner has gotten GPytorch to work with Torchscript (https://github.com/cornellius-gp/gpytorch/issues/970). With these above things in mind, I feel like this direction just needs a bit more of a push and GPytorch can start being used in C++.

Pitch

In the end, I would like to be able to use GPytorch in C++, not just for loading models, (which is what has been implemented), but a 1 to 1 correspondence of features in Python GPytorch and C++ GPytorch. This includes the entire pipeline from data input, training, and inferencing. Many features like optimizes, etc. are already implemented via Pytorch's existing C++ Frontend.

As far as I know, there is not a C++ GP library that has really kicked off. Here are some I have found: CppGPs, GPc, GP, libgp GP Software Wikipedia Page. All of these do not have the feature set that GPytorch does nor the community behind Pytorch. I believe GPytorch is the right candidate to push GPs onto the C++ architecture, especially with the support of the Pytorch community.

acxz avatar Feb 25 '20 13:02 acxz