Skip to content
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

CLI - Add command sb benchmark [list,list-parameters] #279

Merged
merged 5 commits into from Jan 18, 2022

Conversation

abuccts
Copy link
Member

@abuccts abuccts commented Jan 4, 2022

Description

Add command sb benchmark list and sb benchmark list-parameters to support listing all optional parameters for benchmarks.

Examples
$ sb benchmark list -n [a-z]+-bw -o table
Result
--------
mem-bw
nccl-bw
rccl-bw
$ sb benchmark list-parameters -n mem-bw
=== mem-bw ===
optional arguments:
  --bin_dir str         Specify the directory of the benchmark binary.
  --duration int        The elapsed time of benchmark in seconds.
  --mem_type str [str ...]
                        Memory types to benchmark. E.g. htod dtoh dtod.
  --memory str          Memory argument for bandwidthtest. E.g. pinned unpinned.
  --run_count int       The run count of benchmark.
  --shmoo_mode          Enable shmoo mode for bandwidthtest.
default values:
{'bin_dir': None,
 'duration': 0,
 'mem_type': ['htod', 'dtoh'],
 'memory': 'pinned',
 'run_count': 1}

Major Revisions

  • Add sb benchmark list to list benchmarks matching given name.
  • Add sb benchmark list-parameters to list parameters for benchmarks which match given name.

Minor Revisions

  • Sort format help text for argparse.

Add command `sb benchmark list` and `sb benchmark list-parameters` to
support listing all optional paramters for benchmarks.
@abuccts abuccts added the CLI SuperBench CLI label Jan 4, 2022
Fix unit test.
Add docs and tests.
@abuccts abuccts marked this pull request as ready for review January 6, 2022 07:07
@abuccts abuccts requested a review from a team as a code owner January 6, 2022 07:07
@codecov
Copy link

codecov bot commented Jan 6, 2022

Codecov Report

Merging #279 (e041e03) into main (9a909d2) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #279      +/-   ##
==========================================
+ Coverage   88.53%   88.61%   +0.08%     
==========================================
  Files          75       76       +1     
  Lines        4368     4401      +33     
==========================================
+ Hits         3867     3900      +33     
  Misses        501      501              
Flag Coverage Δ
cpu-unit-test 72.48% <100.00%> (+0.21%) ⬆️
cuda-unit-test 88.54% <100.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superbench/benchmarks/base.py 93.70% <100.00%> (+0.18%) ⬆️
superbench/cli/_benchmark_handler.py 100.00% <100.00%> (ø)
superbench/cli/_commands.py 100.00% <100.00%> (ø)
superbench/cli/_help.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9a909d2...e041e03. Read the comment docs.

docs/cli.md Show resolved Hide resolved
docs/cli.md Show resolved Hide resolved
docs/cli.md Outdated Show resolved Hide resolved
docs/cli.md Show resolved Hide resolved
Update command description.
Comment on lines +98 to +99
self.cmd('sb benchmark list-parameters', checks=[NoneCheck()])
self.cmd('sb benchmark list-parameters -n pytorch-[a-z]+', checks=[NoneCheck()])
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to check the exit_code?

Copy link
Member Author

Choose a reason for hiding this comment

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

by default expect_failure is False so exit code is expected to be 0, otherwise the case will fail

@abuccts abuccts enabled auto-merge (squash) January 18, 2022 07:57
@abuccts abuccts merged commit f7ffc54 into main Jan 18, 2022
@abuccts abuccts deleted the xiongyf/add-param-cli branch January 18, 2022 08:40
@cp5555 cp5555 mentioned this pull request Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI SuperBench CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants