Commit Graph

6 Commits

Author SHA1 Message Date
cyy
2fd75667b4 [Caffe2]Remove Caffe2 scripts and benchmarks (#126747)
Due to removal of Caffe2.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/126747
Approved by: https://github.com/ezyang, https://github.com/malfet
2024-06-05 23:46:31 +00:00
dd3a77bc96 Apply UFMT to all files in benchmarks/ (#105928)
Signed-off-by: Edward Z. Yang <ezyang@meta.com>

Pull Request resolved: https://github.com/pytorch/pytorch/pull/105928
Approved by: https://github.com/albanD
2023-07-26 01:18:48 +00:00
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
ccad73ab41 Fix D23995953 import.
Summary: https://github.com/pytorch/pytorch/pull/45511 could not be properly imported

Test Plan: See https://github.com/pytorch/pytorch/pull/45511

Reviewed By: zhangguanheng66

Differential Revision: D23995953

fbshipit-source-id: a6224a67d54617ddf34c2392e65f2142c4e78ea4
2020-09-29 19:30:23 -07:00
fab1795577 move benchmark utils into torch namespace (#41506)
Summary:
Move the timing utils to `torch.utils._benchmark`. I couldn't figure out how to get setuptools to pick it up and put it under `torch` unless it is in the `torch` directory. (And I think it has to be for `setup.py develop` anyway.)

I also modified the record function benchmark since `Timer` and `Compare` should always be available now.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/41506

Reviewed By: ngimel

Differential Revision: D22601460

Pulled By: robieta

fbshipit-source-id: 9cea7ff1dcb0bb6922c15b99dd64833d9631c37b
2020-07-23 09:48:39 -07:00
08227072e2 Benchmark RecordFunction overhead on some models (#40952)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/40952

Adding a benchmark to measure RecordFunction overhead,
currently on resnet50 and lstm models

Test Plan:
python benchmarks/record_function_benchmark/record_function_bench.py
Benchmarking RecordFunction overhead for lstm_jit
Running warmup... finished
Running 100 iterations with RecordFunction... finished
N = 100, avg. time: 251.970 ms, stddev: 39.348 ms
Running 100 iterations without RecordFunction... finished
N = 100, avg. time: 232.828 ms, stddev: 24.556 ms

Reviewed By: dzhulgakov

Differential Revision: D22368357

Pulled By: ilia-cher

fbshipit-source-id: bff4f4e0e06fb80fdfcf85966c2468e48ed7bc98
2020-07-10 08:46:19 -07:00