Make `test.py` device agnostic (#1805)
Summary:
Allows the user to specify an arbitrary device and an arbitrary backend import using environment variables. The three added environment variables are:
- `TIMEOUT` - allows the timeout to be configured to suit the characteristics of the arbitrary device
- `ACCELERATOR` - a string which is added to the devices list, just like `'cpu'`, `'cuda'` & `'mps'` currently are
- `ACCELERATOR_BACKEND` - a string which is the name of the backend package (which doesn't yet exist in upstream `torch`) needed to use `ACCELERATOR`
These environment variables are used as follows:
```
TIMEOUT=100 ACCELERATOR=my_accelerator ACCELERATOR_BACKEND=my_accelerator_backend \
python test.py -k "test_hf_Bert_check_device_my_accelerator"
```
Pull Request resolved: https://github.com/pytorch/benchmark/pull/1805
Reviewed By: msaroufim
Differential Revision: D47993178
Pulled By: xuzhao9
fbshipit-source-id: 1fe3af21e6192b0036eb88167b77eb994facddab