Name Date Size #Lines LOC

..--

README.mdH A D25-Apr-20251.2 KiB4226

__init__.pyH A D25-Apr-2025196 117

bench.pyH A D25-Apr-202510.6 KiB361289

cells.pyH A D25-Apr-20253.6 KiB14299

conftest.pyH A D25-Apr-2025962 3527

custom_lstms.pyH A D25-Apr-202517 KiB511394

factory.pyH A D25-Apr-202517.2 KiB534410

fuser.pyH A D25-Apr-20251.4 KiB3732

profile.pyH A D25-Apr-20254.5 KiB172135

runner.pyH A D25-Apr-20253 KiB11090

scratch.pyH A D25-Apr-20251 KiB5435

test.pyH A D25-Apr-20255.8 KiB183141

test_bench.pyH A D25-Apr-20251.6 KiB5742

README.md

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