Skip to content

Commit

Permalink
Fix some typos (#5521)
Browse files Browse the repository at this point in the history
  • Loading branch information
apivovarov authored Sep 5, 2023
1 parent e22c9ce commit b8b0e71
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 20 deletions.
3 changes: 1 addition & 2 deletions .style.yapf
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ force_multiline_dict=False
i18n_comment=#\..*

# The i18n function call names. The presence of this function stops
# reformattting on that line, because the string it has cannot be moved
# reformatting on that line, because the string it has cannot be moved
# away from the i18n comment.
i18n_function_call=N_, _

Expand Down Expand Up @@ -391,4 +391,3 @@ split_penalty_logical_operator=300

# Use the Tab character for indentation.
use_tabs=False

6 changes: 3 additions & 3 deletions API_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ See the
for more on training a network on multiple XLA devices with multi-processing.

### Running on TPU Pods
Multi-host setup for different accelerators can be very different. This doc will talk about the device independent bits of multi-host training and will use the TPU + PJRT runtime(currently available on 1.13 and 2.x releases) as an example.
Multi-host setup for different accelerators can be very different. This doc will talk about the device independent bits of multi-host training and will use the TPU + PJRT runtime(currently available on 1.13 and 2.x releases) as an example.

Before you being, please take a look at our user guide at [here](https://cloud.google.com/tpu/docs/run-calculation-pytorch) which will explain some Google Cloud basis like how to use `gcloud` command and how to setup your project. You can also check [here](https://cloud.google.com/tpu/docs/how-to) for all Cloud TPU Howto. This doc will focus on the PyTorch/XLA perspective of the Setup.

Expand All @@ -183,7 +183,7 @@ Above `gcloud ssh` command will ssh to all hosts in TPUVM Pod and run the same c

> **NOTE:** You need to run run above `gcloud` command outside of the TPUVM vm.
The model code and training scirpt is the same for the multi-process training and the multi-host training. PyTorch/XLA and the underlying infrastructure will make sure each device is aware of the global topology and each device's local and global ordinal. Cross-device communication will happen across all devices instead of local devices.
The model code and training script is the same for the multi-process training and the multi-host training. PyTorch/XLA and the underlying infrastructure will make sure each device is aware of the global topology and each device's local and global ordinal. Cross-device communication will happen across all devices instead of local devices.

For more details regarding PJRT runtime and how to run it on pod, please refer to this [doc](https://github.com/pytorch/xla/blob/master/docs/pjrt.md#tpu). For more information about PyTorch/XLA and TPU pod and a complete guide to run a resnet50 with fakedata on TPU pod, please refer to this [guide](https://cloud.google.com/tpu/docs/pytorch-pods).

Expand Down Expand Up @@ -242,7 +242,7 @@ XLA tensors can be moved from the CPU to an XLA device and from an XLA device
to the CPU. If a view is moved then the data its viewing is also copied to the
other device and the view relationship is not preserved. Put another way,
once data is copied to another device it has no relationship with its
previous device or any tensors on it. Again, depending on how your code operates,
previous device or any tensors on it. Again, depending on how your code operates,
appreciating and accommodating this transition can be important.

### Saving and Loading XLA Tensors
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ To run the tests, follow __one__ of the options below:
export PJRT_DEVICE=GPU GPU_NUM_DEVICES=${NUM_GPU}
```

For more detial on configuring the runtime, please refer to [this doc](https://github.com/pytorch/xla/blob/master/docs/pjrt.md#quickstart)
For more detail on configuring the runtime, please refer to [this doc](https://github.com/pytorch/xla/blob/master/docs/pjrt.md#quickstart)

If you are planning to be building from source and hence using the latest _PyTorch/TPU_ code base,
it is suggested for you to select the _Nightly_ builds when you create a Cloud TPU instance.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ To update your existing training loop, make the following changes:
loss.backward()
- optimizer.step()
+
+ # `xm.optimizer_step` combines gradients across replocas
+ # `xm.optimizer_step` combines gradients across replicas
+ xm.optimizer_step()
if __name__ == '__main__':
Expand Down
8 changes: 4 additions & 4 deletions TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pt-xla-profiler: CompileTime too frequent: 23 counts during 12 steps
pt-xla-profiler: TransferFromServerTime too frequent: 12 counts during 12 steps
```

Following section will explain how to get and understand a more detial metrics report.
Following section will explain how to get and understand a more detail metrics report.

## Get A Metrics Report

Expand Down Expand Up @@ -77,15 +77,15 @@ If you see `aten::` ops other than `nonzero` and `_local_scalar_dense`, that usu
lowering in PyTorch/XLA. Feel free to open a feature request for it on [GitHub issues](https://github.com/pytorch/xla/issues).

## Clar The Metrics Report
If you want to clear the metrics between steps/epoches, you can use
If you want to clear the metrics between steps/epochs, you can use
```Python
import torch_xla.debug.metrics as met

met.clear_all()
```

## Performance Profiling
To profile your workload in depth to undertand bottlenecks please check the following resources:
To profile your workload in depth to understand bottlenecks please check the following resources:
* [Official tutorial](https://cloud.google.com/tpu/docs/pytorch-xla-performance-profiling-tpu-vm)
* [Colab notebook](https://colab.research.google.com/github/pytorch/xla/blob/master/contrib/colab/pytorch-xla-profiling-colab.ipynb)
* [Sample MNIST training script with profiling](https://github.com/pytorch/xla/blob/master/test/test_profile_mp_mnist.py)
Expand Down Expand Up @@ -224,7 +224,7 @@ only be enabled for debugging.
* ```XLA_SYNC_WAIT```: Forces the XLA tensor sync operation to wait for its completion, before
moving to the next step.

* ```XLA_USE_BF16```: If set to 1, tranforms all the _PyTorch_ _Float_ values into _BiFloat16_
* ```XLA_USE_BF16```: If set to 1, transforms all the _PyTorch_ _Float_ values into _BiFloat16_
when sending to the _TPU_ device. Note that when using `XLA_USE_BF16=1` tensor arithmetic will
be done in reduced precision and so tensors will not be accurate if accumulated over time.
For example:
Expand Down
10 changes: 5 additions & 5 deletions configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ variables:
default_value: false
XLA_USE_F16:
description:
- If set to true, tranforms all the PyTorch Float values into Float16
- If set to true, transforms all the PyTorch Float values into Float16
(PyTorch Half type) when sending to devices which supports them.
type: bool
default_value: false
Expand Down Expand Up @@ -410,19 +410,19 @@ variables:
type: string
default_value: "0.01:0.05:0.1:0.2:0.5:0.8:0.9:0.95:0.99"
XLA_RELEASE_GIL_DURING_TRANSFER:
descripton:
description:
- Release Python's GIL when transferring data from the runtime.
type: bool
default_value: true
XLA_STABLEHLO_COMPILE:
descripton:
- Pass StableHLO to XLA PjRt client for compilatoin. This compilation
description:
- Pass StableHLO to XLA PjRt client for compilation. This compilation
flag is experimental. The default_value will be set to true when
StableHLO workflow is mature.
type: bool
default_value: false
XLA_DUMP_POST_OPTIMIZATIONS:
descripton:
description:
- Dump the HLO graph after optimizations. You need to use it together
with XLA_SAVE_TENSORS_FMT='hlo' and XLA_SAVE_TENSORS_FILE='your/location'.
type: bool
Expand Down
4 changes: 2 additions & 2 deletions contrib/colab/xla_builder_autograd.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
" return grad, None, None\n",
"\n",
"\n",
"# Exposes the dynamic slice operation, which will support autograd differentation.\n",
"# Exposes the dynamic slice operation, which will support autograd differentiation.\n",
"def dynamic_slice(input, start_indices, slice_sizes):\n",
" \"\"\"Slices an input tensor.\n",
"\n",
Expand All @@ -168,7 +168,7 @@
" The size of the tensor (its dimension 0) must be the same as the rank of\n",
" the input tensor.\n",
" slice_sizes (list, int): The sizes of the slices. This is a list of Python\n",
" integers, whose lenght must be the same of the rank of the input tensor.\n",
" integers, whose length must be the same of the rank of the input tensor.\n",
" Returns:\n",
" The sliced input tensor.\n",
" \"\"\"\n",
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
# name of the remote build cache silo
#
# CXX_ABI=""
# value for cxx_abi flag; if empty, it is infered from `torch._C`.
# value for cxx_abi flag; if empty, it is inferred from `torch._C`.
#
from __future__ import print_function

Expand Down Expand Up @@ -258,7 +258,7 @@ def bazel_build(self, ext):
# Remote cache authentication.
if GCLOUD_KEY_FILE:
# Temporary workaround to allow PRs from forked repo to run CI. See details at (#5259).
# TODO: Remove the check once self-hosted GHA workers are avaialble to CPU/GPU CI.
# TODO: Remove the check once self-hosted GHA workers are available to CPU/GPU CI.
gclout_key_file_size = os.path.getsize(GCLOUD_KEY_FILE)
if gclout_key_file_size > 1:
bazel_argv.append('--google_credentials=%s' % GCLOUD_KEY_FILE)
Expand Down

0 comments on commit b8b0e71

Please sign in to comment.