Repository navigation
Conversation
perf_generate_param.py and perf_run_sweep.py each define a main() that parses
arguments and then hands them to the worker -- generate_main(args.log_dir) and
sweep_main(args). Their __main__ blocks skip main() and call the worker with no
arguments, so running either module directly fails immediately:
TypeError: generate_main() missing 1 required positional argument: 'log_dir'
TypeError: sweep_main() missing 1 required positional argument: 'args'
Both main() functions are referenced nowhere else, so they are dead code today.
parse_nvme_stats.py, in this same package, already calls main() from its
__main__ block. The bin/ds_nvme_tune console script is unaffected -- it does its
own argument parsing and already passes the arguments through.
Signed-off-by: Anai-Guo <antai12232931@outlook.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4f209e117f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| if __name__ == "__main__": | ||
| generate_main() | ||
| main() |
There was a problem hiding this comment.
Add the required sign-off trailer
This non-merge commit has no Signed-off-by trailer, violating the repository's mandatory commit policy and potentially failing DCO enforcement; recreate the commit with --signoff before merging.
AGENTS.md reference: AGENTS.md:L8-L8
Useful? React with 👍 / 👎.
4f209e1 to
6d4e2a9
Compare
Problem
deepspeed/nvme/perf_generate_param.pyanddeepspeed/nvme/perf_run_sweep.pyeach define amain()that parses arguments and hands them to the worker function, and a__main__block that skipsmain()and calls the worker directly with no arguments:So running either module directly fails immediately:
and both
main()functions — the ones that actually do the argument parsing and validation — are referenced nowhere else in the tree, so they are dead code today.Sibling baseline
deepspeed/nvme/parse_nvme_stats.py, in this same package, already does it the right way:__main__callsparse_nvme_stats.pymain()perf_generate_param.pygenerate_main()perf_run_sweep.pysweep_main()Scope
bin/ds_nvme_tuneis not affected and is not touched: it does its own parsing and already passes the arguments through (sweep_main(args)/generate_main(args.log_dir)). The publicdeepspeed.nvmeexports (sweep_main,generate_main,parse_sweep_arguments,ds_io_main) are unchanged — this only fixes direct module invocation.Verification
I replayed the argument binding straight out of the AST rather than hand-copying a repro, so it cannot drift from the source: each worker's parameter list and every call site's shape are read from the files themselves, a signature-identical stub is generated, and the binding is replayed.
After the change both
__main__blocks route throughmain(), which is the call site that already binds correctly.🤖 Generated with Claude Code