Make sure GP model are stored as CPU-only models in MLflow#420
Open
RemiLehe wants to merge 2 commits into
Open
Make sure GP model are stored as CPU-only models in MLflow#420RemiLehe wants to merge 2 commits into
RemiLehe wants to merge 2 commits into
Conversation
During calibration, posterior() sets a prediction_strategy on each sub-GP that holds cached CUDA tensors (Cholesky factors). These are plain Python attributes, so gpytorch's _apply() does not move them when .cpu() is called, causing deserialization to fail on machines without CUDA. Fix by clearing prediction_strategy before .cpu(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
RemiLehe
commented
May 2, 2026
Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
synapse-guienvironment) with:Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is Falseposterior()sets aprediction_strategyon each sub-GP holding cached CUDA tensors (Cholesky factors). These are plain Python attributes, so gpytorch's_apply()does not move them when.cpu()is called, and they get serialized as CUDA tensors into MLflow.prediction_strategyon each sub-GP beforemodel.cpu()inbuild_lume_model. NN/ensemble_NN are unaffected as they have no such cache.