pytorch/benchmarks/fastrnns
Rodrigo Berriel a0dea074b2 Remove .data from benchmarks and tensorboard (#65389)
Summary:
Related to https://github.com/pytorch/pytorch/issues/30987 and https://github.com/pytorch/pytorch/issues/33628. Fix the following tasks:

- Remove the use of `.data` in all our internal code:
  - [x] `benchmarks/`
  - [x] `torch/utils/tensorboard/`

cc pietern mrshenli pritamdamania87 zhaojuanmao satgera rohan-varma gqchen aazzolini osalpekar jiayisuse SciPioneer H-Huang gcramer23 albanD gchanan

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

Reviewed By: soulitzer

Differential Revision: D31093464

Pulled By: albanD

fbshipit-source-id: 3a9c8834fd544a59a1cc2b930ae538fd1d46b232
2021-09-22 11:16:59 -07:00
..
__init__.py Un-ignore F403 in .flake8 (#55838) 2021-04-13 09:24:07 -07:00
bench.py Remove .data from benchmarks and tensorboard (#65389) 2021-09-22 11:16:59 -07:00
cells.py Back out "Revert D25717510: Clean up some type annotations in benchmarks/fastrnns" (#50556) 2021-01-14 15:15:03 -08:00
conftest.py Benchmarks: make fuser and executor configurable from command line. (#44291) 2020-09-09 11:59:35 -07:00
custom_lstms.py Back out "Revert D25717510: Clean up some type annotations in benchmarks/fastrnns" (#50556) 2021-01-14 15:15:03 -08:00
factory.py Add lint for unqualified noqa (#56272) 2021-04-19 13:16:18 -07:00
fuser.py remove non-default settings in fuser.py (#48862) 2020-12-05 20:58:39 -08:00
profile.py Remove .data from benchmarks and tensorboard (#65389) 2021-09-22 11:16:59 -07:00
README.md Lint trailing newlines (#54737) 2021-03-30 13:09:52 -07:00
runner.py Un-ignore F403 in .flake8 (#55838) 2021-04-13 09:24:07 -07:00
scratch.py
test_bench.py Remove .data from benchmarks and tensorboard (#65389) 2021-09-22 11:16:59 -07:00
test.py

Fast RNN benchmarks

Benchmarks for TorchScript models

For most stable results, do the following:

  • Set CPU Governor to performance mode (as opposed to energy save)
  • Turn off turbo for all CPUs (assuming Intel CPUs)
  • Shield cpus via cset shield when running benchmarks.

Some of these scripts accept command line args but most of them do not because I was lazy. They will probably be added sometime in the future, but the default sizes are pretty reasonable.

Test fastrnns (fwd + bwd) correctness

Test the fastrnns benchmarking scripts with the following: python -m fastrnns.test or run the test independently: python -m fastrnns.test --rnns jit

Run benchmarks

python -m fastrnns.bench

should give a good comparison, or you can specify the type of model to run

python -m fastrnns.bench --rnns cudnn aten jit --group rnns

Run model profiling, calls nvprof

python -m fastrnns.profile

should generate nvprof file for all models somewhere. you can also specify the models to generate nvprof files separately:

python -m fastrnns.profile --rnns aten jit

Caveats

Use Linux for the most accurate timing. A lot of these tests only run on CUDA.