1
1
# Contribute To PyTorch/XLA
2
2
3
- We appreciate all contributions. If you are planning to contribute a bug fix for
3
+ We appreciate all contributions. If you are planning to contribute a bug fix for
4
4
an open issue, please comment on the thread and we're happy to provide guidance.
5
- You are welcome to pick issues with [ good first issue] ( https://github.com/pytorch/xla/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22 )
6
- and [ help wanted] ( https://github.com/pytorch/xla/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22 )
5
+ You are welcome to pick issues with [ good first issue] ( https://github.com/pytorch/xla/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22 )
6
+ and [ help wanted] ( https://github.com/pytorch/xla/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22 )
7
7
labels to get started.
8
8
9
- If you plan to contribute new features or extensions to this repository, first
10
- open an issue and discuss the feature with us. Sending a PR without discussion
11
- might result in a rejected PR, because we might be taking the repository in a
9
+ If you plan to contribute new features or extensions to this repository, first
10
+ open an issue and discuss the feature with us. Sending a PR without discussion
11
+ might result in a rejected PR, because we might be taking the repository in a
12
12
different direction.
13
13
14
14
## Building from source
15
15
16
- We recommend you use our prebuilt Docker image to start your development work
16
+ We recommend you use our prebuilt Docker image to start your development work
17
17
using either VS Code or a local container:
18
18
19
19
### Visual Studio Code Dev Container
20
20
21
- * Create an empty directory for your workspace on your development host. These
22
- instructions assume you are using a remote host and are connecting to it over
21
+ * Create an empty directory for your workspace on your development host. These
22
+ instructions assume you are using a remote host and are connecting to it over
23
23
SSH.
24
-
24
+
25
25
* Clone PyTorch, TorchVision, and PyTorch/XLA into your workspace directory:
26
26
27
27
``` bash
@@ -51,17 +51,17 @@ using either VS Code or a local container:
51
51
[ ` Dev Containers ` ] ( https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers )
52
52
extensions.
53
53
54
- * From VS Code, connect to your remote host and open your workspace directory.
55
- You will be prompted to reopen your workspace in container. Choose the
56
- appropriate container. Use ` tpu-contributor ` if you are unsure of which to use.
57
- If you are not prompted to reopen in a container, in the VS Code command
58
- pallete, type ` Dev Containers: Reopen in Container ` to open your workspace in
59
- one of our pre-built Docker containers. Select the correct container based on
54
+ * From VS Code, connect to your remote host and open your workspace directory.
55
+ You will be prompted to reopen your workspace in container. Choose the
56
+ appropriate container. Use ` tpu-contributor ` if you are unsure of which to use.
57
+ If you are not prompted to reopen in a container, in the VS Code command
58
+ pallete, type ` Dev Containers: Reopen in Container ` to open your workspace in
59
+ one of our pre-built Docker containers. Select the correct container based on
60
60
your local accelerator. If you're a Googler, you should use the ` tpu-internal `
61
61
container, which is set up for [ bazel remote build caching] ( https://github.com/pytorch/xla/blob/master/docs/source/contribute/bazel.md#remote-caching )
62
62
for faster builds.
63
63
64
- * Open a new terminal window in VS Code. Since you are running as root in this
64
+ * Open a new terminal window in VS Code. Since you are running as root in this
65
65
container, mark the repository directories as safe. The commands below assume
66
66
your workspace directory is ` torch ` , update the commands to use your workspace
67
67
directory.
@@ -71,7 +71,7 @@ using either VS Code or a local container:
71
71
git config --global --add safe.directory /workspaces/torch/pytorch/xla
72
72
git config --global --add safe.directory /workspaces/torch/vision
73
73
```
74
- * In the terminal window, run the following commands to build PyTorch,
74
+ * In the terminal window, run the following commands to build PyTorch,
75
75
TorchVision, and PyTorch/XLA:
76
76
77
77
``` bash
@@ -89,15 +89,15 @@ using either VS Code or a local container:
89
89
-f https://storage.googleapis.com/libtpu-releases/index.html
90
90
```
91
91
92
- * If you are running on a TPU VM, ensure ` torch ` and ` torch_xla ` were built and
92
+ * If you are running on a TPU VM, ensure ` torch ` and ` torch_xla ` were built and
93
93
installed correctly:
94
94
95
95
``` bash
96
96
python -c ' import torch_xla as xla; print(xla.device())'
97
97
# Output: xla:0
98
98
```
99
99
100
- ** Subsequent builds** : after building the packages from source code for the
100
+ ** Subsequent builds** : after building the packages from source code for the
101
101
first time, you may need to build everything again, for example, after a
102
102
` git pull ` . You can run ` scripts/build_developer.sh ` which will rebuild PyTorch,
103
103
TorchVision, and PyTorch/XLA.
0 commit comments