Skip to content

Commit cf9f792

Browse files
committed
MAINT: Change multi-word flags from _ to -
Command line flags that are multi-word should use - not _. Changing this everywhere
1 parent ce5a7e5 commit cf9f792

File tree

4 files changed

+35
-35
lines changed

4 files changed

+35
-35
lines changed

docs/command_line_interface.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11

22
```sh
3-
iris-gpubench [--benchmark_image BENCHMARK_IMAGE | --benchmark_command BENCHMARK_COMMAND] [--interval INTERVAL] [--carbon_region CARBON_REGION] [--live_plot] [--export_to_meerkat] [--monitor_logs]
3+
iris-gpubench [--benchmark-image BENCHMARK_IMAGE | --benchmark-command BENCHMARK_COMMAND] [--interval INTERVAL] [--carbon-region CARBON_REGION] [--live-plot] [--export-to-meerkat] [--monitor-logs]
44
```
55

66
The following optional arguments are supported:
77

8-
- `--no_live_monitor`: Disable live monitoring of GPU metrics. Default is enabled.
8+
- `--no-live-monitor`: Disable live monitoring of GPU metrics. Default is enabled.
99
- `--interval <seconds>`: Set the interval for collecting GPU metrics. Default is `5` seconds.
10-
- `--carbon_region <region>`: Specify the carbon region for the National Grid ESO Regional Carbon Intensity API. Default is `"South England"`.
11-
- `--no_plot`: Disable plotting of GPU metrics, saves as png. Default is enabled.
12-
- `--live_plot`: Enable live plotting of GPU metrics and saves plot to png.
13-
- `--export_to_meerkat`: Enable exporting of collected data to Meerkat DB to be scrapped by the Grafana Dashboard.
14-
- `--benchmark_image <image>`: Docker container image to run as a benchmark.
15-
- `--benchmark_command <command>`: Command to run as a benchmark in a `tmux` session. This option allows running benchmarks without Docker.
16-
- `--monitor_logs`: Enable monitoring of container or tmux logs in addition to GPU metrics.
10+
- `--carbon-region <region>`: Specify the carbon region for the National Grid ESO Regional Carbon Intensity API. Default is `"South England"`.
11+
- `--no-plot`: Disable plotting of GPU metrics, saves as png. Default is enabled.
12+
- `--live-plot`: Enable live plotting of GPU metrics and saves plot to png.
13+
- `--export-to-meerkat`: Enable exporting of collected data to Meerkat DB to be scrapped by the Grafana Dashboard.
14+
- `--benchmark-image <image>`: Docker container image to run as a benchmark.
15+
- `--benchmark-command <command>`: Command to run as a benchmark in a `tmux` session. This option allows running benchmarks without Docker.
16+
- `--monitor-logs`: Enable monitoring of container or tmux logs in addition to GPU metrics.
1717

1818
## Help Option
1919

@@ -25,7 +25,7 @@ iris-gpubench --help
2525

2626
## Using the Meerkat Exporter
2727

28-
For the `--export_to_meerkat` option, the Meerkat username, password, and URL must be set as environment variables. Use the following commands:
28+
For the `--export-to-meerkat` option, the Meerkat username, password, and URL must be set as environment variables. Use the following commands:
2929

3030
```bash
3131
export MEERKAT_USERNAME='insert_username'
@@ -36,10 +36,10 @@ export MEERKAT_URL='https://172.16.101.182:8247/write'
3636
(As of 12/09/24, this is the correct URL.)
3737

3838
## Useful to know
39-
- Either `--benchmark_image` or `--benchmark_command` must be provided, but not both. If both options are specified, an error will be raised.
40-
- Live GPU metrics monitoring and saving a final plot are enabled by default; use `--no_live_monitor` and `--no_plot` to disable them, respectively.
41-
- To view the available carbon regions, use `--carbon_region ""` to get a list of all regions.
42-
- To list available Docker images, use `--benchmark_image ""` for a list of images.
39+
- Either `--benchmark-image` or `--benchmark-command` must be provided, but not both. If both options are specified, an error will be raised.
40+
- Live GPU metrics monitoring and saving a final plot are enabled by default; use `--no-live-monitor` and `--no-plot` to disable them, respectively.
41+
- To view the available carbon regions, use `--carbon-region ""` to get a list of all regions.
42+
- To list available Docker images, use `--benchmark-image ""` for a list of images.
4343

4444
For example commands please see the next page.
4545

docs/example_commands.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,31 @@
44
### Example 1: Basic Monitoring with Completion Plot:
55

66
```sh
7-
iris-gpubench --benchmark_image "synthetic_regression"
7+
iris-gpubench --benchmark-image "synthetic_regression"
88
```
99

1010
- **Explanation**: This command runs GPU monitoring while executing the benchmark specified by the Docker image `synthetic_regression`. The system will collect GPU metrics and generate a completion plot at the end. Live monitoring of GPU metrics is enabled by default.
1111

1212
### Example 2: Exporting Data to VictoriaMetrics:
1313

1414
```sh
15-
iris-gpubench --benchmark_image "synthetic_regression" --export_to_meerkat
15+
iris-gpubench --benchmark-image "synthetic_regression" --export-to-meerkat
1616
```
1717

1818
- **Explanation**: Similar to the first example, this command runs the `synthetic_regression` Docker image benchmark and collects GPU metrics. Additionally, the collected data is exported to Meerkat for long-term storage and further analysis. This is useful when you need to monitor metrics over time and visualize them later using external tools such as the Grafana Dashboard.
1919

2020
### Example 3: Full Command with All Options:
2121

2222
```sh
23-
iris-gpubench --benchmark_image "stemdl_classification" --interval 10 --carbon_region "South England" --live_plot --export_to_meerkat --monitor_logs
23+
iris-gpubench --benchmark-image "stemdl_classification" --interval 10 --carbon-region "South England" --live-plot --export-to-meerkat --monitor-logs
2424
```
2525

26-
- **Explanation**: This is a comprehensive example that runs the `stemdl_classificatio` benchmark in a Docker container and collects GPU metrics at a 10-second interval. The `--carbon_region` flag specifies the carbon intensity region as "South England" to track the carbon emissions impact. Live plotting of GPU metrics is enabled (`--live_plot`), and data will be exported to Meerkat DB via VictoriaMetrics (`--export_to_meerkat`). The `--monitor_logs` flag enables logging of both GPU metrics and the Docker container logs, allowing for deeper analysis of benchmark performance.
26+
- **Explanation**: This is a comprehensive example that runs the `stemdl_classificatio` benchmark in a Docker container and collects GPU metrics at a 10-second interval. The `--carbon-region` flag specifies the carbon intensity region as "South England" to track the carbon emissions impact. Live plotting of GPU metrics is enabled (`--live-plot`), and data will be exported to Meerkat DB via VictoriaMetrics (`--export-to-meerkat`). The `--monitor-logs` flag enables logging of both GPU metrics and the Docker container logs, allowing for deeper analysis of benchmark performance.
2727

2828
### Example 4: Run and Monitor Benchmark in the Background without the Need for a Container:
2929

3030
```sh
31-
/mantid_imaging_cloud_bench$ iris-gpubench --benchmark_command "./run_1.sh" --live_plot --interval 1
31+
/mantid_imaging_cloud_bench$ iris-gpubench --benchmark-command "./run_1.sh" --live-plot --interval 1
3232
```
3333

3434
- **Explanation**: In this example, a benchmark command (`./run_1.sh`) is executed in the background using `tmux` instead of a Docker container. GPU metrics are collected at 1-second intervals, and live plotting of these metrics is enabled. This is useful when you have a script or binary that doesn't require containerization and want to monitor the system's GPU usage in real-time. Running benchmarks in `tmux` allows the process to continue in the background, making it ideal for long-running benchmarks that don't need constant attention.

docs/live_monitoring.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Current GPU Metrics (Tesla V100-PCIE-32GB) as of 2024-09-12 16:53:14:
2525
## Monitor Benchmark Container/Tmux Logs
2626

2727
```sh
28-
gpu_monitor --benchmark_image "synthetic_regression" --monitor_logs
28+
gpu_monitor --benchmark-image "synthetic_regression" --monitor-logs
2929

3030
Container Logs:
3131
<BEGIN> Running benchmark synthetic_regression in training mode
@@ -65,14 +65,14 @@ Gives you saves plot png during every reading so that the metrics can be viewed
6565

6666
**Example command and Results:**
6767
```sh
68-
gpu_monitor --benchmark_image "stemdl_classification_2gpu" --plot_live
68+
gpu_monitor --benchmark-image "stemdl_classification_2gpu" --plot_live
6969
```
7070
This command was run on a VM with 2 V100 GPUs for the results in [Collecting Results Section](collecting_results.md#gpu-metrics-timeseries-plot-png).
7171

7272

7373
## (Grafana) Timeseries Plot Live
7474

75-
If the `--export_to_meerkat` tag is used the results can be viewed live from the Grafana Dashboard. Data from multiple VMs can be collected all at once allowing for a live comparison of performance as well.
75+
If the `--export-to-meerkat` tag is used the results can be viewed live from the Grafana Dashboard. Data from multiple VMs can be collected all at once allowing for a live comparison of performance as well.
7676

7777
See example results [Collecting Results Section](collecting_results.md#gpu-metric-grafana-plots).
7878

iris_gpubench/utils/cli.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,46 +40,46 @@ def parse_arguments(get_carbon_region_names_func):
4040
description='Monitor GPU metrics and optionally export data to MeerkatDB.'
4141
)
4242

43-
parser.add_argument('--no_live_monitor', action='store_true',
43+
parser.add_argument('--no-live-monitor', action='store_true',
4444
help='Disable live monitoring of GPU metrics (default is enabled).')
4545

4646
parser.add_argument('--interval', type=int, default=MONITOR_INTERVAL,
4747
help=f'Interval in seconds for collecting GPU metrics (default is {MONITOR_INTERVAL} seconds).')
4848

49-
parser.add_argument('--carbon_region', type=str, default='South England',
49+
parser.add_argument('--carbon-region', type=str, default='South England',
5050
help='Region shorthand for The National Grid ESO Regional Carbon Intensity API (default is "South England").')
5151

52-
parser.add_argument('--no_plot', action='store_true',
52+
parser.add_argument('--no-plot', action='store_true',
5353
help='Disable plotting of GPU metrics (default is enabled).')
5454

55-
parser.add_argument('--live_plot', action='store_true',
55+
parser.add_argument('--live-plot', action='store_true',
5656
help='Enable live plotting of GPU metrics.')
5757

58-
parser.add_argument('--export_to_meerkat', action='store_true',
58+
parser.add_argument('--export-to-meerkat', action='store_true',
5959
help='Enable exporting of collected data to MeerkatDB.')
6060

61-
parser.add_argument('--benchmark_image', type=str,
61+
parser.add_argument('--benchmark-image', type=str,
6262
help='Docker container image to run as a benchmark.')
6363

64-
parser.add_argument('--benchmark_command', type=str,
64+
parser.add_argument('--benchmark-command', type=str,
6565
help='Command to run as a benchmark in a tmux session.')
6666

67-
parser.add_argument('--monitor_logs', action='store_true',
67+
parser.add_argument('--monitor-logs', action='store_true',
6868
help='Enable monitoring of container or tmux logs in addition to GPU metrics.')
6969

70-
parser.add_argument('--nvidia_nsights', action='store_true',
70+
parser.add_argument('--nvidia-nsights', action='store_true',
7171
help='Enable Nvidia Nsights to do extra GPU and CPU sampling.')
7272

7373
args = parser.parse_args()
7474

7575
# Validate arguments
7676
if not args.benchmark_image and not args.benchmark_command:
77-
LOGGER.error("Neither '--benchmark_image' nor '--benchmark_command' provided. One must be specified.")
78-
parser.error("You must specify either '--benchmark_image' or '--benchmark_command'.")
77+
LOGGER.error("Neither '--benchmark-image' nor '--benchmark-command' provided. One must be specified.")
78+
parser.error("You must specify either '--benchmark-image' or '--benchmark-command'.")
7979

8080
if args.benchmark_image and args.benchmark_command:
81-
LOGGER.error("Both '--benchmark_image' and '--benchmark_command' provided. Only one must be specified.")
82-
parser.error("You must specify either '--benchmark_image' or '--benchmark_command', not both.")
81+
LOGGER.error("Both '--benchmark-image' and '--benchmark-command' provided. Only one must be specified.")
82+
parser.error("You must specify either '--benchmark-image' or '--benchmark-command', not both.")
8383

8484
if args.interval <= 0:
8585
error_message = f"Monitoring interval must be a positive integer. Provided value: {args.interval}"

0 commit comments

Comments
 (0)