Skip to content

Commit 476ca6b

Browse files
authored
Add developer setup section to README.md (pytorch#105)
1 parent 78056e2 commit 476ca6b

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,56 @@ function to be executed in a new Python frame which recursively will
325325
trigger TorchDynamo to re-start its capture once execution reaches that
326326
point for the first time.
327327

328+
## Minimal Developer Setup
329+
330+
As background reading, I'd suggest looking at the
331+
[PyTorch](https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md),
332+
[functorch](https://github.com/pytorch/functorch), and
333+
[TorchBench](https://github.com/pytorch/benchmark#installation)
334+
setup docs. Since these projects work together in different ways.
335+
336+
The following instructions use [Miniconda](https://docs.conda.io/en/latest/miniconda.html).
337+
338+
```
339+
conda create --name=torchdynamo python=3.8
340+
conda activate torchdynamo
341+
342+
# install pytorch nightlies
343+
# for CUDA version, replace `cpuonly` with `cudatoolkit=11.3`
344+
conda install pytorch torchvision torchaudio torchtext cpuonly -c pytorch-nightly
345+
346+
git clone [email protected]:facebookresearch/torchdynamo.git
347+
cd torchdynamo
348+
pip install -r requirements.txt
349+
350+
# check if everything works
351+
make test
352+
```
353+
354+
If see errors about missing symbols from `guards.so`, that may mean your
355+
C++ compiler is incompatible CUDA and/or with the one used to compile
356+
PyTorch. You may need to change your compiler version or build PyTorch
357+
from source.
358+
359+
To add TorchBench, which is useful for benchmarking and more extensive
360+
testing:
361+
```
362+
# you should still be in the conda env from before
363+
364+
cd .. # if still in torchdynamo/
365+
366+
# download everything
367+
git clone [email protected]:jansel/benchmark.git torchbenchmark
368+
python torchbenchmark/install.py
369+
370+
cd torchdynamo
371+
372+
# fix the version of black so `make format` / `make lint` work
373+
make lint-deps
374+
375+
# make sure it works
376+
./torchbench.py
377+
```
328378

329379
## Tests
330380

0 commit comments

Comments
 (0)