cuml
cuml copied to clipboard
POC for improved model state serialization
At the moment, cuML's models can only be serialized thanks to Pickle
. This proof of concept PR uses Google's Protocol Buffer library (Protobuf
) to serialize the state of cuML models. This allows :
- Importation from Python as previously, but as well from C++ or any language for which we could build bindings to
libcuml
- In the future, this could provide a convenient data structure to hold content of models for C++ users
- More compact serialization files
- Possibility to have the whole cuML library as a Triton backend or at least produce an equivalent simpler gRPC inference server.
In this example (see pytest) a LinearRegression
model is trained, serialized to disk, deserialized and finally tested for the correctness of its predictions.
Added do not merge label since I'll be mostly away for the next couple of weeks, and want to be part of the discussion(s)
Hi @viclafargue, one thing to keep in mind: protocol buffers have a size limitation of 2 GiB (cheet-sheet). While it is not an issue here, we should still think about what would be the strategy for models that need to save large arrays.
Hi @viclafargue, one thing to keep in mind: protocol buffers have a size limitation of 2 GiB (cheet-sheet). While it is not an issue here, we should still think about what would be the strategy for models that need to save large arrays.
Thanks for noticing that @tfeher. That is indeed a problem. One solution to that would be to store the CumlArrays data in separate files. An other solution would be to create a whole new file format to store the models, but that would mean that we would have to maintain custom code for serialization in Python and C++.
This PR has been labeled inactive-30d
due to no recent activity in the past 30 days. Please close this PR if it is no longer required. Otherwise, please respond with a comment indicating any updates. This PR will be labeled inactive-90d
if there is no activity in the next 60 days.
This PR has been labeled inactive-90d
due to no recent activity in the past 90 days. Please close this PR if it is no longer required. Otherwise, please respond with a comment indicating any updates.
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB