1# Fast RNN benchmarks 2 3Benchmarks for TorchScript models 4 5For most stable results, do the following: 6- Set CPU Governor to performance mode (as opposed to energy save) 7- Turn off turbo for all CPUs (assuming Intel CPUs) 8- Shield cpus via `cset shield` when running benchmarks. 9 10Some of these scripts accept command line args but most of them do not because 11I was lazy. They will probably be added sometime in the future, but the default 12sizes are pretty reasonable. 13 14## Test fastrnns (fwd + bwd) correctness 15 16Test the fastrnns benchmarking scripts with the following: 17`python -m fastrnns.test` 18or run the test independently: 19`python -m fastrnns.test --rnns jit` 20 21## Run benchmarks 22 23`python -m fastrnns.bench` 24 25should give a good comparison, or you can specify the type of model to run 26 27`python -m fastrnns.bench --rnns cudnn aten jit --group rnns` 28 29## Run model profiling, calls nvprof 30 31`python -m fastrnns.profile` 32 33should generate nvprof file for all models somewhere. 34you can also specify the models to generate nvprof files separately: 35 36`python -m fastrnns.profile --rnns aten jit` 37 38### Caveats 39 40Use Linux for the most accurate timing. A lot of these tests only run 41on CUDA. 42