Skip to content

There's a limit of 1112 trials on single-objective experiments, 556 on two-objective #291

@mrcslws

Description

@mrcslws

I'm hitting a hard limit on the number of trials in an experiment. With a single-metric objective this limit is 1112 trials. With a two-metric MultiObjective, the limit is 556. In all these cases, I get error:

UnsupportedError:  SobolQMCSampler only supports dimensions `q * o <= 1111`.

This MultiObjective trend will continue, 3-objective models will have a limit of 1112/3 trials, etc.

There are two separate lines of questions here:

  1. (Am I doing something silly?)
  2. Is the limit of 1112 trials known? Is it By Design?
  3. Is there a good reason that the multi-objective case has a lower limit? In hyperparameter search you generally need more trials for multi-objective experiments, not fewer.

Single-objective demo

from ax.service.ax_client import AxClient

PARAMETERS = [
    {"name": "x", "type": "range", "bounds": [12.2, 602.2], "value_type": "float"},
]

def example_f(x):
    # Distance from a multiple of 33
    mod33 = x - (x // 33) * 33
    if mod33 > 33 // 2:
        return 33 - mod33
    else:
        return mod33

NUM_TRIALS = 1200
ax_client = AxClient()
ax_client.create_experiment(
    parameters=PARAMETERS,
    choose_generation_strategy_kwargs=dict(
        # Random trials aren't necessary, but they're faster for demo purposes.
        num_initialization_trials=1112,
    ),
    minimize=True,
)

for i in range(NUM_TRIALS):
    parameters, trial_index = ax_client.get_next_trial()
    ax_client.complete_trial(trial_index=trial_index,
                             raw_data=example_f(parameters["x"]))

Result

The Botorch model doesn't work after there are more than 1111 results.

  File "/site-packages/ax/modelbridge/generation_strategy.py", line 300, in gen
    keywords=get_function_argument_names(model.gen),
  File "/site-packages/ax/modelbridge/base.py", line 616, in gen
    model_gen_options=model_gen_options,
  File "/site-packages/ax/modelbridge/array.py", line 212, in _gen
    target_fidelities=target_fidelities,
  File "/site-packages/ax/modelbridge/torch.py", line 214, in _model_gen
    target_fidelities=target_fidelities,
  File "/site-packages/ax/models/torch/botorch.py", line 363, in gen
    **acf_options,
  File "/site-packages/ax/models/torch/botorch_defaults.py", line 211, in get_NEI
    seed=torch.randint(1, 10000, (1,)).item(),
  File "/site-packages/botorch/acquisition/utils.py", line 96, in get_acquisition_function
    prune_baseline=kwargs.get("prune_baseline", False),
  File "/site-packages/botorch/acquisition/monte_carlo.py", line 221, in __init__
    model=model, X=X_baseline, objective=objective
  File "/site-packages/botorch/acquisition/utils.py", line 219, in prune_inferior_points
    samples = sampler(posterior)
  File "/site-packages/torch/nn/modules/module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/site-packages/botorch/sampling/samplers.py", line 57, in forward
    self._construct_base_samples(posterior=posterior, shape=base_sample_shape)
  File "/site-packages/botorch/sampling/samplers.py", line 234, in _construct_base_samples
    "SobolQMCSampler only supports dimensions "
botorch.exceptions.errors.UnsupportedError: SobolQMCSampler only supports dimensions `q * o <= 1111`. Requested: 1112

I tried setting "acquisition_function_kwargs" prune_baseline=False, but the error still eventually occurs on another codepath. So I haven't found a workaround.

Metadata

Metadata

Assignees

Labels

upstream issueResolution depends on upstream fixes

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions