Skip to content

All attributes in gen_specs are passed to the workers as copies #975

@AngelFP

Description

@AngelFP

I currently have a workflow with a persistent generator where the actual generator object (for example, an Ax client) is passed to the gen_f as an attribute contained in the gen_specs. Then, inside the gen_f, this generator object is used to determine the new configurations to evaluate.

The problem is that after the run is completed, the original generator I created appears to be unchanged. See the (dummy) example below:

# Create generator and add to `gen_specs`
ax_client = AxClient(...)
gen_specs['user']['ax_client'] = ax_client

# Run ensemble
libE(gen_specs, ...)

# Try to get information from generator
ax_client.get_best_trial()  # <- this will fail because ax_client is still empty of trials

This is because the ax_client that the gen_f was using was actually a copy of the one that was created in the calling script.

Is there any way of passing an object to the gen_f without it being a copy? It would be sufficient if this could be done with just one of the workers (i.e., with the worker taking care of running the persistent generator)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions