Skip to content

Commit

Permalink
Update README.md (#297)
Browse files Browse the repository at this point in the history
* Update README.md

* Update conftest.py
  • Loading branch information
wconstab committed Mar 6, 2021
1 parent 9c9fcf2 commit 06fb1e7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ for hints about how to replicate the CI environment if you have issues
with pip torch, or mix built-from-source torch with pip torchtext. It's important to match even the conda channel (nightly vs regular).
This is due to differences in the compilation process used by different packaging systems producing incompatible python binary extensions.

## Using a low-noise machine
Various sources of noise, such as interrupts, context switches, clock frequency scaling, etc. can all conspire to make benchmark results variable. It's important to understand the level of noise in your setup before drawing conclusions from benchmark data. While any machine can in principle be tuned up, the steps and end-results vary with OS, kernel, drivers, and hardware. To this end, torchbenchmark picks a favorite machine type it can support well, and provides utilities for automating tuning on that machine. In the future, we may support more machine types and would be happy for contributions here.

The currently supported machine type is an AWS g4dn.metal instance using Amazon Linux. This is one of the subset of AWS instance types that supports [processor state control](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/processor_state_control.html), with documented tuning guides for Amazon Linux. Most or all of these steps should be possible on Ubuntu but haven't been automated yet.

To tune your g4dn.metal Amazon Linux machine, run
```
sudo `which python` torchbenchmark/util/machine_config.py --configure
```

When running pytest (see below), the machine_config script is invoked to assert a proper configuration and log config info into the output json. It is possible to ```--ignore_machine_config``` if running pytest without tuning is desired.


## Running Model Benchmarks
There are currently two top-level scripts for running the models.
Expand Down
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def pytest_sessionstart(session):
check_machine_configured()
except Exception as e:
if not session.config.getoption('ignore_machine_config'):
pytest.exit(f"{e}\nUse --ignore_machine_config arg if not running with recommended tuning settings")
pytest.exit(f"{e}\nSee README.md for machine tuning script usage, or use --ignore_machine_config")

def pytest_configure(config):
set_fuser(config.getoption("fuser"))
Expand Down

0 comments on commit 06fb1e7

Please sign in to comment.