-
Notifications
You must be signed in to change notification settings - Fork 8
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
Update SLURM builder #323
base: main
Are you sure you want to change the base?
Update SLURM builder #323
Conversation
…i into update-slurm-builder
typer.Option( | ||
help=("Which directory to search for the scalability metrics in.") | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
our formatters will keep fighting on this forever hahaha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha yeah I think I have my line length a bit shorter than yours. Mine doesn't use the project-wide one I think
@app.command( | ||
context_settings={"allow_extra_args": True, "ignore_unknown_options": True} | ||
) | ||
def generate_slurm(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be nice to replicate arguments and options of the argument parser here as well. This would generate a nice help page, helping the users to understand what options they can use and what type they receive. You can take inspiration from exec_pipeline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see two limitations with this solution. First, I guess that if you use --help
instead of -h
, this help page will not appear -- a bit inconsistent and may generate confusion. Second, the CLI reference is not generated in the dedicated docs page
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding the first limitation: This is possible to change by simply setting add_help_option=False
.
The CLI reference might not be as easy to fix. We could just add them as arguments, but there are 23 of them in total. Looking at the other Annotated
variables they take between 1 and 8 lines each, where most seem to take 5-6. This would result in around 100-150 lines of variables. Certainly doable and might be the best fix, but certainly worth thinking about. What do you think? Should I add them? 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose the biggest downside would be that we would have all the descriptions in two places, as well as all the variables. We could solve this by removing the descriptions from the argparser and maybe having an automatic test (in tests/
) that checks that the params are the same between the argparser and the function? Just thinking out loud here.
Another option is to change the parsing mechanism to use the newest parser. That way we wouldn't have the whole double thing. The disadvantage is that it could potentially be a lot of work for something that already works the way it is.
Summary
Updates to the
itwinai
SLURM builder. See issue #288 for more information.Brief overview:
--no-save-script
is activepytest
'stmp_path
instead oftempfile
'sTemporaryDirectory
wherever possibleslurm.sh
andrunall.sh
files from use casesslurm.py
files in EURAC and VirgoTorchTrainer
etc.Related issues : #288, #316 #318, #319, #320, #324, #325