Skip to content

Dynamic slurm generation.#84

Merged
XkunW merged 14 commits intomainfrom
dynamic_slurm
Apr 10, 2025
Merged

Dynamic slurm generation.#84
XkunW merged 14 commits intomainfrom
dynamic_slurm

Conversation

@kohankhaki
Copy link
Contributor

This pull request includes dependency updates and the addition of a new SlurmScriptGenerator class for generating SLURM scripts.

  • Updated the requires-python field in pyproject.toml.
  • Removed multiple environment variable settings from the set_env_vars method in vec_inf/cli/_helper.py.
  • Introduced the SlurmScriptGenerator class in vec_inf/cli/_slurm_script_generator.py to dynamically generate SLURM scripts based on the parameters provided.

@kohankhaki kohankhaki requested a review from XkunW April 4, 2025 13:08
@codecov-commenter
Copy link

codecov-commenter commented Apr 4, 2025

Codecov Report

Attention: Patch coverage is 79.06977% with 18 lines in your changes missing coverage. Please review.

Project coverage is 82.39%. Comparing base (acbc33b) to head (a6a090c).
Report is 182 commits behind head on main.

Files with missing lines Patch % Lines
vec_inf/client/_slurm_script_generator.py 75.34% 18 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #84      +/-   ##
==========================================
- Coverage   82.88%   82.39%   -0.49%     
==========================================
  Files          11       12       +1     
  Lines         777      835      +58     
==========================================
+ Hits          644      688      +44     
- Misses        133      147      +14     
Files with missing lines Coverage Δ
vec_inf/cli/_helper.py 77.34% <100.00%> (ø)
vec_inf/client/_helper.py 79.73% <100.00%> (+0.22%) ⬆️
vec_inf/client/_vars.py 100.00% <100.00%> (ø)
vec_inf/client/_slurm_script_generator.py 75.34% <75.34%> (ø)

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

base += [""]
return "\n".join(base)

def _export_parallel_vars(self) -> str:
Copy link
Contributor

Choose a reason for hiding this comment

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

These are only being exported so that they can be consumed when generating the shared args right? Can we just populate the parameters directly instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, will remove this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

forgot to tag, fixed this.

pyproject.toml Outdated
authors = [{name = "Marshall Wang", email = "marshall.wang@vectorinstitute.ai"}]
license = "MIT"
requires-python = ">=3.10"
requires-python = ">=3.10,<4.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't think we need this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but when I didn't have it, it was trying to use Python 3.12 and ran into dependency issues. That's why I changed it. But I guess we can leave that for another PR if it's still a problem.
I was still using Poetry.

Copy link
Contributor

Choose a reason for hiding this comment

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

This file is outdated and is of no use at the moment, might retire it in the future, I'd say just leave it as is for now, especially now we're no longer using poetry

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay


def _export_parallel_vars(self) -> str:
if self.is_multinode:
return """if [ "$PIPELINE_PARALLELISM" = "True" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we're generating these scripts dynamically, we shouldn't need to have any if else statements in the generated scripts. This logic should go directly into _generate_shared_args, which it looks like you have the same checks in that function already.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

forgot to tag, fixed this.

@XkunW XkunW merged commit 9ffac32 into main Apr 10, 2025
6 checks passed
@XkunW XkunW deleted the dynamic_slurm branch April 10, 2025 22:04
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.

4 participants

Comments