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

Add support for overwriting parameters via CLI #79

Merged
merged 3 commits into from
Dec 13, 2021
Merged

Conversation

n-gao
Copy link
Collaborator

@n-gao n-gao commented Dec 3, 2021

Co-authored-by: Leon Hetzel

Reference issue

Issue #71

What does this implement/fix?

seml <collection> add <yaml> -o [<key>=<value>]

Additional information

<key> should use the flattened dictionary notation with . and <value> is evaluated by eval.

n-gao and others added 2 commits December 3, 2021 14:47
Co-authored-by: Leon Hetzel <MxMstrmn@users.noreply.github.com>
seml/add.py Outdated
@@ -136,7 +137,7 @@ def add_experiments(db_collection_name, config_file, force_duplicates, no_hash=F
if 'conda_environment' not in seml_config:
seml_config['conda_environment'] = os.environ.get('CONDA_DEFAULT_ENV')

# Set Slurm config with default parameters as fall-back option
# Set Slurm config with default parameters as fall-back option
slurm_config = merge_dicts(SETTINGS.SLURM_DEFAULT, slurm_config)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a related note: can we also make it possible to overwrite slurm parameters when starting experiments? Sometimes I screw up the partition or so and then I have to re-queue everything.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds like a good idea. However, I think we should open a follow-up issue on that and have a separate PR since the logic will be distinct from this one.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this use the same interface? e.g. --with slurm.sbatch_options.mem=25G or so?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use a separate argument and unify the style with seml jupyter where you have the -sb option to supply sbatch parameters. However, there you need to provide a dictionary which is not very user-friendly. In conjunction with this PR it could look something like:

seml <collection> add <yaml> -o dataset=imagenet -sb mem=25G

We could reuse the key-value parsing we introduce with this PR for the sbatch parameters but integrating both into one argument makes parsing more difficult and user always have to nest their parameters and sbatch options with sbatch.xyz and config.xyz.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that nesting with config. each time is not super user friendly. I suggest we do -sb mem=25G partition=gpu_all etc. separately (which is I think what you suggested)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes :)

Copy link
Collaborator

@danielzuegner danielzuegner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Feel free to merge!

@n-gao n-gao merged commit a4740c6 into master Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants