Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation scenario trial_memory_limit #1101

Open
JosuaCarl opened this issue Mar 20, 2024 · 1 comment
Open

Documentation scenario trial_memory_limit #1101

JosuaCarl opened this issue Mar 20, 2024 · 1 comment
Labels
documentation Documentation is needed/added.

Comments

@JosuaCarl
Copy link

question

Description

Set the limit for memory usage in a Scenario with trial_memory_limit = 8000

Steps/Code to Reproduce

scenario = Scenario(
configspace,
n_trials=1000,
min_budget=5,
max_budget=25,
n_workers=1,
output_directory=outdir,
walltime_limit=3600, # Max time in s (3600 = 1h)
cputime_limit=np.inf,
trial_memory_limit=8000,
)

smac = MultiFidelityFacade(
scenario,
train,
initial_design=initial_design,
intensifier=intensifier,
overwrite=True
)

incumbent = smac.optimize()

Expected Results

The Memory is limited to 8000 MB ~ 8 GB, as described in the docstring.

Actual Results

The memory seems to be limited to 8000 Bytes, the warning message
2024-03-20 11:17:27.320008: F tensorflow/tsl/platform/default/env.cc:74] Check failed: ret == 0 (11 vs. 0)Thread tf_numa_-1_Eigen creation via pthread_create() failed. Current memory usage in new process is 4571389952B but setting limit to 8000B. Likely to fail, try increasing the memory limit
and the resulting error pynisher.exceptions.PynisherException: Unknown reason for exitcode -6, no result or error recieved and killed process MLP.train(Configuration(values={...}), seed=..., budget=8.333333333333332) appears.

Versions

'2.0.2'

Proposed solution

  • Change line 55 in smac/scenario.py from The maximum memory in MB that a trial is allowed to use. If not specified, to The maximum memory in Bytes (B) that a trial is allowed to use. If not specified,
@eddiebergman
Copy link
Contributor

eddiebergman commented Mar 20, 2024

Just as an addition to this to the SMAC developers, the undeyling library allows for tuples of the form (8, "GB") or (8000, "MB") as well, which might be a bit more intuitive:
*https://github.com/automl/pynisher?tab=readme-ov-file#parameters

@benjamc benjamc added the documentation Documentation is needed/added. label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation is needed/added.
Projects
Status: No status
Development

No branches or pull requests

3 participants