Skip to content

Commit a92fbed

Browse files
authored
Merge pull request #3 from CentML/may26-update-readme
Update README file
2 parents 6f6344f + 1a7cf1d commit a92fbed

File tree

1 file changed

+34
-48
lines changed

1 file changed

+34
-48
lines changed

README.md

Lines changed: 34 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,46 @@
1-
# Habitat: A Runtime-Based Computational Performance Predictor for Deep Neural Network Training
2-
3-
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4885489.svg)](https://doi.org/10.5281/zenodo.4885489)
4-
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4876277.svg)](https://doi.org/10.5281/zenodo.4876277)
5-
1+
# Habitat
62
Habitat is a tool that predicts a deep neural network's training iteration
73
execution time on a given GPU. It currently supports PyTorch. To learn more
84
about how Habitat works, please see our [research
95
paper](https://arxiv.org/abs/2102.00527).
6+
## Installation
7+
You can install Habitat using the prebuilt wheel files. To install, download the whl files from the [releases page](https://github.com/CentML/habitat/releases) then run:
8+
```sh
9+
pip install habitat*.whl
10+
```
1011

12+
## Usage example
13+
You can verify your Habitat installation by running the simple usage example. This example measures a single inference iteration of Resnet50 on the RTX2080Ti and extrapolates the runtime to the V100.
14+
```py
15+
import habitat
16+
import torch
17+
import torchvision.models as models
1118

12-
## Running From Source
13-
14-
Currently, the only way to run Habitat is to build it from source. You should
15-
use the Docker image provided in this repository to make sure that you can
16-
compile the code.
17-
18-
1. Download the [Habitat pre-trained
19-
models](https://doi.org/10.5281/zenodo.4876277).
20-
2. Run `extract-models.sh` under `analyzer` to extract and install the
21-
pre-trained models.
22-
3. Run `setup.sh` under `docker/` to build the Habitat container image.
23-
4. Run `start.sh` to start a new container. By default, your home directory
24-
will be mounted inside the container under `~/home`.
25-
5. Once inside the container, run `install-dev.sh` under `analyzer/` to build
26-
and install the Habitat package.
27-
6. In your scripts, `import habitat` to get access to Habitat. See
28-
`experiments/run_experiment.py` for an example showing how to use Habitat.
29-
30-
**Note:** Habitat needs access to your GPU's performance counters, which
31-
requires special permissions if you are running with a recent driver (418.43 or
32-
later). If you encounter a `CUPTI_ERROR_INSUFFICIENT_PRIVILEGES` error when
33-
running Habitat, please follow the instructions
34-
[here](https://developer.nvidia.com/ERR_NVGPUCTRPERM)
35-
and in [issue #5](https://github.com/geoffxy/habitat/issues/5).
36-
37-
38-
## License
39-
40-
The code in this repository is licensed under the Apache 2.0 license (see
41-
`LICENSE` and `NOTICE`), with the exception of the files mentioned below.
42-
43-
This software contains source code provided by NVIDIA Corporation. These files
44-
are:
19+
# Define model and sample inputs
20+
model = models.resnet50().cuda()
21+
image = torch.rand(8, 3, 224, 224).cuda()
4522

46-
- The code under `cpp/external/cupti_profilerhost_util/` (CUPTI sample code)
47-
- `cpp/src/cuda/cuda_occupancy.h`
23+
# Measure a single inference
24+
tracker = habitat.OperationTracker(device=habitat.Device.RTX2080Ti)
25+
with tracker.track():
26+
out = model(image)
4827

49-
The code mentioned above is licensed under the [NVIDIA Software Development
50-
Kit End User License Agreement](https://docs.nvidia.com/cuda/eula/index.html).
28+
trace = tracker.get_tracked_trace()
29+
print("Run time on source:", trace.run_time_ms)
5130

52-
We include the implementations of several deep neural networks under
53-
`experiments/` for our evaluation. These implementations are copyrighted by
54-
their original authors and carry their original licenses. Please see the
55-
corresponding `README` files and license files inside the subdirectories for
56-
more information.
31+
# Perform prediction to a single target device
32+
pred = trace.to_device(habitat.Device.V100)
33+
print("Predicted time on V100:", pred.run_time_ms)
34+
```
35+
## Development Environment Setup
36+
Habitat requires both the native component and the Python binding to function. For detailed installation instructions, see [INSTALL.md](INSTALL.md).
5737

38+
## Release process
39+
Run the `Build Habitat` GitHub action. This will build the wheel files for each platform.
5840

59-
## Research Paper
41+
## Release history
42+
See [Releases](https://github.com/CentML/habitat/releases).
43+
## Meta
6044

6145
Habitat began as a research project in the [EcoSystem
6246
Group](https://www.cs.toronto.edu/ecosystem) at the [University of
@@ -79,3 +63,5 @@ If you use Habitat in your research, please consider citing our paper:
7963
year = {2021},
8064
}
8165
```
66+
## Contributing
67+
- Guidelines on how to contribute to the project

0 commit comments

Comments
 (0)