File: README.md

package info (click to toggle)
pytorch 1.13.1%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 139,252 kB
  • sloc: cpp: 1,100,274; python: 706,454; ansic: 83,052; asm: 7,618; java: 3,273; sh: 2,841; javascript: 612; makefile: 323; xml: 269; ruby: 185; yacc: 144; objc: 68; lex: 44
file content (41 lines) | stat: -rw-r--r-- 1,179 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# 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.