pytorch/benchmarks
Xuehai Pan a229b4526f [BE] Prefer dash over underscore in command-line options (#94505)
Preferring dash over underscore in command-line options. Add `--command-arg-name` to the argument parser. The old arguments with underscores `--command_arg_name` are kept for backward compatibility.

Both dashes and underscores are used in the PyTorch codebase. Some argument parsers only have dashes or only have underscores in arguments. For example, the `torchrun` utility for distributed training only accepts underscore arguments (e.g., `--master_port`). The dashes are more common in other command-line tools. And it looks to be the default choice in the Python standard library:

`argparse.BooleanOptionalAction`: 4a9dff0e5a/Lib/argparse.py (L893-L895)

```python
class BooleanOptionalAction(Action):
    def __init__(...):
            if option_string.startswith('--'):
                option_string = '--no-' + option_string[2:]
                _option_strings.append(option_string)
```

It adds `--no-argname`, not `--no_argname`. Also typing `_` need to press the shift or the caps-lock key than `-`.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/94505
Approved by: https://github.com/ezyang, https://github.com/seemethere
2023-02-09 20:16:49 +00:00
..
cpp [NVFuser] Upstream push 1026 (#87779) 2022-11-04 20:04:34 +00:00
distributed [BE] Prefer dash over underscore in command-line options (#94505) 2023-02-09 20:16:49 +00:00
dynamo [BE] Prefer dash over underscore in command-line options (#94505) 2023-02-09 20:16:49 +00:00
fastrnns [BE] Prefer dash over underscore in command-line options (#94505) 2023-02-09 20:16:49 +00:00
framework_overhead_benchmark [BE] Prefer dash over underscore in command-line options (#94505) 2023-02-09 20:16:49 +00:00
functional_autograd_benchmark Fix exception causes all over the codebase (#90271) 2022-12-07 04:29:00 +00:00
fuser
instruction_counts [BE] Prefer dash over underscore in command-line options (#94505) 2023-02-09 20:16:49 +00:00
nested Use tensor cores for NT bmm (#86856) 2022-11-02 21:51:40 +00:00
operator_benchmark [BE] Prefer dash over underscore in command-line options (#94505) 2023-02-09 20:16:49 +00:00
overrides_benchmark
profiler_benchmark [BE] Prefer dash over underscore in command-line options (#94505) 2023-02-09 20:16:49 +00:00
record_function_benchmark [BE] Prefer dash over underscore in command-line options (#94505) 2023-02-09 20:16:49 +00:00
serialization
sparse [BE] Prefer dash over underscore in command-line options (#94505) 2023-02-09 20:16:49 +00:00
static_runtime [BE] Tweak Meta copyright headers (#90805) 2022-12-14 20:30:31 +00:00
tensorexpr [BE] Prefer dash over underscore in command-line options (#94505) 2023-02-09 20:16:49 +00:00
transformer [BE] Prefer dash over underscore in command-line options (#94505) 2023-02-09 20:16:49 +00:00
compare-fastrnn-results.py
compare.sh
README.md
upload_scribe.py [BE] Prefer dash over underscore in command-line options (#94505) 2023-02-09 20:16:49 +00:00

PyTorch Benchmarks

This folder contains scripts that produce reproducible timings of various PyTorch features.

It also provides mechanisms to compare PyTorch with other frameworks.

Setup environment

Make sure you're on a machine with CUDA, torchvision, and pytorch installed. Install in the following order:

# Install torchvision. It comes with the pytorch stable release binary
conda install pytorch torchvision -c pytorch

# Install the latest pytorch master from source.
# It should supersede the installation from the release binary.
cd $PYTORCH_HOME
python setup.py build develop

# Check the pytorch installation version
python -c "import torch; print(torch.__version__)"

Benchmark List

Please refer to each subfolder to discover each benchmark suite