Skip to content

cp: fix: Use nargs for custom_bash_cmds (2261) into r0.3.0#2262

Merged
ko3n1g merged 1 commit intor0.3.0from
cherry-pick-2261-r0.3.0
Feb 6, 2026
Merged

cp: fix: Use nargs for custom_bash_cmds (2261) into r0.3.0#2262
ko3n1g merged 1 commit intor0.3.0from
cherry-pick-2261-r0.3.0

Conversation

@ko3n1g
Copy link
Copy Markdown
Contributor

@ko3n1g ko3n1g commented Feb 6, 2026

beep boop [🤖]: Hi @ko3n1g 👋,

we've cherry picked #2261 into  for you! 🚀

Please review and approve this cherry pick by your convenience!

Summary by CodeRabbit

  • Improvements
    • Modified the --custom_bash_cmds argument format in performance testing scripts to accept a flexible list-based structure, replacing the previous comma-separated string input method.

Signed-off-by: oliver könig <okoenig@nvidia.com>
Signed-off-by: NeMo Bot <nemo-bot@nvidia.com>
@ko3n1g
Copy link
Copy Markdown
Contributor Author

ko3n1g commented Feb 6, 2026

/ok to test 64060e6

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot bot commented Feb 6, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

The pull request modifies how custom bash commands are parsed from CLI arguments and propagated through the execution pipeline. The argument parser now uses nargs="*" with action="append" instead of a custom type converter, and updates function signatures throughout to reflect a change in data structure from List[str] to List[List[str]], with corresponding logic adjustments in the executor to join command tokens.

Changes

Cohort / File(s) Summary
Custom bash commands argument handling
scripts/performance/argument_parser.py, scripts/performance/setup_experiment.py, scripts/performance/utils/executors.py
Changed -cb/--custom_bash_cmds argument parsing from custom type=list_of_strings to nargs="*" with action="append". Updated function signatures from List[str] to List[List[str]] and modified executor logic to join inner lists into single command strings before execution.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

r0.3.0

Suggested reviewers

  • erhoo82
  • malay-nagda
🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Test Results For Major Changes ⚠️ Warning PR implements breaking API change (List[str] to List[List[str]]) without documenting test results or validation evidence in the description. Add test results documenting that modified argument parsing correctly handles the new List[List[str]] structure and existing tests pass.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title references a cherry-pick operation and includes the upstream PR number (#2261), which describes the actual change (using nargs for custom_bash_cmds), but the title itself focuses on the cherry-pick action rather than the primary technical change.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cherry-pick-2261-r0.3.0

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@scripts/performance/setup_experiment.py`:
- Line 209: The parameter type for custom_bash_cmds is incorrect: change its
annotation from List[List[str]] to Optional[List[List[str]]] (and add/import
Optional from typing) so the function signature reflects that
args.custom_bash_cmds can be None (argparse default) before it is forwarded to
slurm_executor; update the signature that contains the custom_bash_cmds
parameter in scripts/performance/setup_experiment.py and ensure any local usages
still handle None safely.

In `@scripts/performance/utils/executors.py`:
- Line 67: The parameter custom_bash_cmds currently uses an implicit Optional by
being annotated as List[List[str]] = None; update its type annotation to an
explicit union using the PEP 604 form (e.g., List[List[str]] | None or
list[list[str]] | None) so the signature explicitly shows None is allowed;
locate the parameter named custom_bash_cmds in the executor function signature
in scripts/performance/utils/executors.py and replace the implicit Optional
annotation with the explicit `| None` form while keeping the default = None.

custom_env_vars: Dict[str, str],
custom_srun_args: List[str],
custom_bash_cmds: List[str],
custom_bash_cmds: List[List[str]],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Type hint should be nullable since default=None in argparse.

args.custom_bash_cmds can be None (the argparse default), and this None is passed straight through to slurm_executor which handles it on line 82 of executors.py. The signature here should reflect that.

Proposed fix
-    custom_bash_cmds: List[List[str]],
+    custom_bash_cmds: list[list[str]] | None,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
custom_bash_cmds: List[List[str]],
custom_bash_cmds: list[list[str]] | None,
🤖 Prompt for AI Agents
In `@scripts/performance/setup_experiment.py` at line 209, The parameter type for
custom_bash_cmds is incorrect: change its annotation from List[List[str]] to
Optional[List[List[str]]] (and add/import Optional from typing) so the function
signature reflects that args.custom_bash_cmds can be None (argparse default)
before it is forwarded to slurm_executor; update the signature that contains the
custom_bash_cmds parameter in scripts/performance/setup_experiment.py and ensure
any local usages still handle None safely.

wandb_key: str = None,
network: str = None,
custom_bash_cmds: List[str] = None,
custom_bash_cmds: List[List[str]] = None,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Implicit Optional — use explicit | None annotation.

Ruff RUF013 flags this, and coding guidelines require T | None over implicit Optional.

Proposed fix
-    custom_bash_cmds: List[List[str]] = None,
+    custom_bash_cmds: list[list[str]] | None = None,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
custom_bash_cmds: List[List[str]] = None,
custom_bash_cmds: list[list[str]] | None = None,
🧰 Tools
🪛 Ruff (0.14.14)

[warning] 67-67: PEP 484 prohibits implicit Optional

Convert to T | None

(RUF013)

🤖 Prompt for AI Agents
In `@scripts/performance/utils/executors.py` at line 67, The parameter
custom_bash_cmds currently uses an implicit Optional by being annotated as
List[List[str]] = None; update its type annotation to an explicit union using
the PEP 604 form (e.g., List[List[str]] | None or list[list[str]] | None) so the
signature explicitly shows None is allowed; locate the parameter named
custom_bash_cmds in the executor function signature in
scripts/performance/utils/executors.py and replace the implicit Optional
annotation with the explicit `| None` form while keeping the default = None.

@ko3n1g ko3n1g merged commit ae58d30 into r0.3.0 Feb 6, 2026
50 of 52 checks passed
@ko3n1g ko3n1g deleted the cherry-pick-2261-r0.3.0 branch February 6, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant