[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[],[],null,["# Troubleshooting PyTorch - TPU\n=============================\n\nThis guide provides troubleshooting information to\nhelp you identify and resolve problems you might encounter while training\nPyTorch models on Cloud TPU. For a more general guide to\ngetting started with Cloud TPU, see the\n[PyTorch quickstart](/tpu/docs/run-calculation-pytorch).\n| **Note:** If you aren't able to resolve your issue using this guide, see [Getting Support](/tpu/docs/getting-support) for further assistance.\n\nTroubleshooting slow training performance\n-----------------------------------------\n\nIf your model trains slowly, [generate and review a metrics report.](https://pytorch.org/xla/release/r2.6/learn/troubleshoot.html#get-a-metrics-report)\n\nTo automatically analyze the metrics report and provide a summary, run\nyour workload with PT_XLA_DEBUG=1.\n\nFor more information about issues that might cause your model to train slowly,\nsee [Known performance caveats](https://pytorch.org/xla/release/r2.6/learn/troubleshoot.html#known-performance-caveats).\n\nPerformance profiling\n---------------------\n\nTo profile your workload in-depth to discover bottlenecks, review these resources:\n\n- [PyTorch/XLA performance profiling](https://cloud.google.com/tpu/docs/pytorch-xla-performance-profiling-tpu-vm)\n- [Sample MNIST training script with profiling](https://github.com/pytorch/xla/blob/master/test/test_profile_mp_mnist.py)\n\nMore debugging tools\n--------------------\n\nYou can specify [environment variables](https://pytorch.org/xla/release/r2.6/learn/troubleshoot.html#environment-variables)\nto control the behavior of the PyTorch/XLA software stack.\n\nIf you encounter an unexpected bug and need help, [file a GitHub issue](https://github.com/pytorch/xla).\n\nManaging XLA tensors\n--------------------\n\n[XLA tensor Quirks](https://pytorch.org/xla/release/r2.6/learn/troubleshoot.html#xla-tensor-quirks)\ndescribes what you should and shouldn't do when working with XLA tensors and\nshared weights."]]