File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 4
4
# This source code is licensed under the MIT license found in the
5
5
# LICENSE file in the root directory of this source tree.
6
6
7
+ import gpytorch .settings as gp_settings
8
+ import linear_operator .settings as linop_settings
7
9
from botorch import (
8
10
acquisition ,
9
11
exceptions ,
24
26
gen_candidates_torch ,
25
27
get_best_candidates ,
26
28
)
29
+ from botorch .logging import logger
27
30
from botorch .utils import manual_seed
28
31
29
-
30
32
try :
31
33
from botorch .version import version as __version__
32
34
except Exception : # pragma: no cover
33
35
__version__ = "Unknown" # pragma: no cover
34
36
37
+ logger .info (
38
+ "Turning off `fast_computations` in linear operator and increasing "
39
+ "`max_cholesky_size` and `max_eager_kernel_size` to 4096, and "
40
+ "`cholesky_max_tries` to 6. The approximate computations available in "
41
+ "GPyTorch aim to speed up GP training and inference in large data "
42
+ "regime but they are generally not robust enough to be used in a BO-loop. "
43
+ "See gpytorch.settings & linear_operator.settings for more details."
44
+ )
45
+ linop_settings ._fast_covar_root_decomposition ._default = False
46
+ linop_settings ._fast_log_prob ._default = False
47
+ linop_settings ._fast_solves ._default = False
48
+ linop_settings .cholesky_max_tries ._global_value = 6
49
+ linop_settings .max_cholesky_size ._global_value = 4096
50
+ gp_settings .max_eager_kernel_size ._global_value = 4096
51
+
35
52
36
53
__all__ = [
37
54
"acquisition" ,
Original file line number Diff line number Diff line change 6
6
7
7
import warnings
8
8
9
+ import gpytorch .settings as gp_settings
10
+ import linear_operator .settings as linop_settings
9
11
from botorch import settings
10
12
from botorch .exceptions import BotorchWarning
11
13
from botorch .utils .testing import BotorchTestCase
@@ -46,3 +48,13 @@ def test_debug(self):
46
48
with warnings .catch_warnings (record = True ) as ws :
47
49
warnings .warn ("test" , BotorchWarning )
48
50
self .assertEqual (len (ws ), 0 )
51
+
52
+
53
+ class TestDefaultGPyTorchLinOpSettings (BotorchTestCase ):
54
+ def test_default_gpytorch_linop_settings (self ):
55
+ self .assertTrue (linop_settings ._fast_covar_root_decomposition .off ())
56
+ self .assertTrue (linop_settings ._fast_log_prob .off ())
57
+ self .assertTrue (linop_settings ._fast_solves .off ())
58
+ self .assertEqual (linop_settings .cholesky_max_tries .value (), 6 )
59
+ self .assertEqual (linop_settings .max_cholesky_size .value (), 4096 )
60
+ self .assertEqual (gp_settings .max_eager_kernel_size .value (), 4096 )
You can’t perform that action at this time.
0 commit comments