-
Notifications
You must be signed in to change notification settings - Fork 110
[bugfix] Fix constraint evaluation for Slurm features starting with numbers #3448
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
Conversation
👎 this naively breaks any expression, will try fix. |
You can also try the unit tests locally by running |
b91b06d
to
4e6267d
Compare
I scratched the original idea of prefixing all symbols, as inserting the booleans directly seems easier if the symbols needs to be replaced anyway. PS: Sorry for the force-push spam (I intended to rebase & tidy the history). I think it's ready to be reviewed now. |
eval
for Slurm features starting with numbers
Evaluating Slurm feature as symbols (with dash replaced) won't work for features like `8xT4` which are valid to Slurm. This commit directly inserts existence of Slurm features as booleans. `re.sub` should avoid potentially overlapping matches.
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 like very much your solution; it's much cleaner! I'll just need to test it a bit more thoroughly before merging it.
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've tested it and it looks good. Just a couple of style comments.
Co-authored-by: Vasileios Karakasis <vkarak@gmail.com>
Thanks! Committed the suggested changes. |
eval
for Slurm features starting with numbers
Features starting with a number (e.g.
4xA40
) seem valid to slurm, but are not valid python identifiers. Currently this causes nodes getting filtered out when such feature is used as constraints.This prefixes all variables during eval with underscore to get around it.Edit: this now inserts boolean values directly into the constraints to support such Slurm features.