You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's a few updates to the GPyTorch and GPFlow benchmark code that I believe will make a better comparison to both packages:
Using whitened variational inference - the whitening operation is known to dramatically accelerate the convergence of variational optimization without any additional computational complexity. (Importantly, the GPyTorch UnwhitenedVariationalStrategy is very old code that uses out-dated linear algebra. We haven't updated it because we wouldn't normally recommend using it at all.)
For the gpytorch data loader - set num_workers=0. More num_workers is (counterintuitively) slower for non-image datasets, as it requires thread synchronization.
You are comparing GPyTorch/GPFlow SVGP models against Falkon's kernel ridge regression - which essentially compares the timing difference of large kernel matrix operations against the convergence rate of SGD. Whitening is a known technique that improves SGD's convergence rate for SVGP (without any additional complexity).
Hi @gpleiss
I have one question regarding the use of whitened vs unwhitened:
When running with natural gradients, 3k inducing points, I'm seeing a 3x slowdown with the whitened strategy. Do you have any ideas on what could be the cause?
When running with natural gradients, 3k inducing points, I'm seeing a 3x slowdown with the whitened strategy. Do you have any ideas on what could be the cause?
benchmark_millionsongs.sh from the benchmark branch. To change the variational distribution you can change the VAR variable between "full", "diag". If you set NATGRAD_LR to 0 then you'll be doing SGD with Adam. If you actually want to run the script, you'll also need to change some hardcoded paths in the datasets.py file (check line 181). If needed, I can share the data (it's the standard million songs dataset https://archive.ics.uci.edu/ml/datasets/yearpredictionmsd).
Ah I understand the discrepancy now. In VariationalStrategy we cast the Cholesky call to double precision, which is not something we do in UnwhitenedVariationalStrategy (again - unwhitened is old code which hasn't been updated in a while).
With M=1000 or 2000, usually this extra precision doesn't take much time. At M=4000 you start to see a difference, but the double precision usually is necessary for later epochs to prevent numerical errors.
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
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.
Here's a few updates to the GPyTorch and GPFlow benchmark code that I believe will make a better comparison to both packages:
Using whitened variational inference - the whitening operation is known to dramatically accelerate the convergence of variational optimization without any additional computational complexity. (Importantly, the GPyTorch
UnwhitenedVariationalStrategyis very old code that uses out-dated linear algebra. We haven't updated it because we wouldn't normally recommend using it at all.)For the gpytorch data loader - set
num_workers=0. More num_workers is (counterintuitively) slower for non-image datasets, as it requires thread synchronization.You are comparing GPyTorch/GPFlow SVGP models against Falkon's kernel ridge regression - which essentially compares the timing difference of large kernel matrix operations against the convergence rate of SGD. Whitening is a known technique that improves SGD's convergence rate for SVGP (without any additional complexity).
cc/ @jacobrgardner - @jameshensman, @alexggmatthews am I missing anything on the GPFlow end?