Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TPU] v4 support #17227

Merged
merged 13 commits into from
Apr 11, 2023
Merged

[TPU] v4 support #17227

merged 13 commits into from
Apr 11, 2023

Conversation

carmocca
Copy link
Contributor

@carmocca carmocca commented Mar 29, 2023

What does this PR do?

Updates the codebase and test suite to support the v4 nodes out of the box.

In these, "auto" needs to default to 4, not 8

cc @Borda @JackCaoG @steventk-g @Liyang90 @carmocca @justusschock @awaelchli

@carmocca carmocca added feature Is an improvement or enhancement accelerator: tpu Tensor Processing Unit labels Mar 29, 2023
@carmocca carmocca added this to the 2.1 milestone Mar 29, 2023
@carmocca carmocca self-assigned this Mar 29, 2023
@github-actions github-actions bot added fabric lightning.fabric.Fabric pl Generic label for PyTorch Lightning package labels Mar 29, 2023
@carmocca carmocca marked this pull request as ready for review March 29, 2023 21:04
@github-actions
Copy link
Contributor

github-actions bot commented Mar 29, 2023

⚡ Required checks status: All passing 🟢

Groups summary

🟢 pytorch_lightning: Tests workflow
Check ID Status
pl-cpu (macOS-11, lightning, 3.8, 1.11) success
pl-cpu (macOS-11, lightning, 3.9, 1.12) success
pl-cpu (macOS-11, lightning, 3.10, 1.13) success
pl-cpu (macOS-11, lightning, 3.10, 2.0) success
pl-cpu (macOS-11, lightning, 3.8, 1.11, oldest) success
pl-cpu (ubuntu-20.04, lightning, 3.8, 1.11) success
pl-cpu (ubuntu-20.04, lightning, 3.9, 1.12) success
pl-cpu (ubuntu-20.04, lightning, 3.10, 1.13) success
pl-cpu (ubuntu-20.04, lightning, 3.10, 2.0) success
pl-cpu (ubuntu-20.04, lightning, 3.8, 1.11, oldest) success
pl-cpu (windows-2022, lightning, 3.8, 1.11) success
pl-cpu (windows-2022, lightning, 3.9, 1.12) success
pl-cpu (windows-2022, lightning, 3.10, 1.13) success
pl-cpu (windows-2022, lightning, 3.10, 2.0) success
pl-cpu (windows-2022, lightning, 3.8, 1.11, oldest) success
pl-cpu (macOS-11, pytorch, 3.8, 1.13) success
pl-cpu (ubuntu-20.04, pytorch, 3.8, 1.13) success
pl-cpu (windows-2022, pytorch, 3.8, 1.13) success

These checks are required after the changes to src/lightning/fabric/accelerators/tpu.py, src/lightning/fabric/connector.py, src/lightning/fabric/plugins/environments/xla.py, src/lightning/fabric/strategies/single_device.py, src/lightning/fabric/strategies/single_tpu.py, src/lightning/fabric/utilities/device_parser.py, src/lightning/pytorch/accelerators/tpu.py, src/lightning/pytorch/strategies/single_device.py, src/lightning/pytorch/strategies/single_tpu.py, src/lightning/pytorch/strategies/xla.py, src/lightning/pytorch/trainer/connectors/accelerator_connector.py, tests/tests_pytorch/accelerators/test_tpu.py, tests/tests_pytorch/callbacks/test_device_stats_monitor.py, tests/tests_pytorch/conftest.py, tests/tests_pytorch/models/test_tpu.py, tests/tests_pytorch/profilers/test_xla_profiler.py, tests/tests_pytorch/strategies/test_registry.py, tests/tests_pytorch/trainer/connectors/test_accelerator_connector.py, tests/tests_pytorch/trainer/properties/test_estimated_stepping_batches.py.

🟢 pytorch_lightning: Azure GPU
Check ID Status
pytorch-lightning (GPUs) success

These checks are required after the changes to src/lightning/pytorch/accelerators/tpu.py, src/lightning/pytorch/strategies/single_device.py, src/lightning/pytorch/strategies/single_tpu.py, src/lightning/pytorch/strategies/xla.py, src/lightning/pytorch/trainer/connectors/accelerator_connector.py, tests/tests_pytorch/accelerators/test_tpu.py, tests/tests_pytorch/callbacks/test_device_stats_monitor.py, tests/tests_pytorch/conftest.py, tests/tests_pytorch/models/test_tpu.py, tests/tests_pytorch/profilers/test_xla_profiler.py, tests/tests_pytorch/strategies/test_registry.py, tests/tests_pytorch/trainer/connectors/test_accelerator_connector.py, tests/tests_pytorch/trainer/properties/test_estimated_stepping_batches.py, src/lightning/fabric/accelerators/tpu.py, src/lightning/fabric/connector.py, src/lightning/fabric/plugins/environments/xla.py, src/lightning/fabric/strategies/single_device.py, src/lightning/fabric/strategies/single_tpu.py, src/lightning/fabric/utilities/device_parser.py.

🟢 fabric: Docs
Check ID Status
make-doctest (fabric) success
make-html (fabric) success

These checks are required after the changes to src/lightning/fabric/accelerators/tpu.py, src/lightning/fabric/connector.py, src/lightning/fabric/plugins/environments/xla.py, src/lightning/fabric/strategies/single_device.py, src/lightning/fabric/strategies/single_tpu.py, src/lightning/fabric/utilities/device_parser.py.

🟢 pytorch_lightning: Docs
Check ID Status
make-doctest (pytorch) success
make-html (pytorch) success

These checks are required after the changes to src/lightning/pytorch/accelerators/tpu.py, src/lightning/pytorch/strategies/single_device.py, src/lightning/pytorch/strategies/single_tpu.py, src/lightning/pytorch/strategies/xla.py, src/lightning/pytorch/trainer/connectors/accelerator_connector.py, docs/source-pytorch/accelerators/tpu_advanced.rst, docs/source-pytorch/accelerators/tpu_basic.rst, docs/source-pytorch/accelerators/tpu_faq.rst, docs/source-pytorch/accelerators/tpu_intermediate.rst.

🟢 lightning_fabric: CPU workflow
Check ID Status
fabric-cpu (macOS-11, lightning, 3.8, 1.11) success
fabric-cpu (macOS-11, lightning, 3.9, 1.12) success
fabric-cpu (macOS-11, lightning, 3.10, 1.13) success
fabric-cpu (macOS-11, lightning, 3.10, 2.0) success
fabric-cpu (macOS-11, lightning, 3.8, 1.11, oldest) success
fabric-cpu (ubuntu-20.04, lightning, 3.8, 1.11) success
fabric-cpu (ubuntu-20.04, lightning, 3.9, 1.12) success
fabric-cpu (ubuntu-20.04, lightning, 3.10, 1.13) success
fabric-cpu (ubuntu-20.04, lightning, 3.10, 2.0) success
fabric-cpu (ubuntu-20.04, lightning, 3.8, 1.11, oldest) success
fabric-cpu (windows-2022, lightning, 3.8, 1.11) success
fabric-cpu (windows-2022, lightning, 3.9, 1.12) success
fabric-cpu (windows-2022, lightning, 3.10, 1.13) success
fabric-cpu (windows-2022, lightning, 3.10, 2.0) success
fabric-cpu (windows-2022, lightning, 3.8, 1.11, oldest) success
fabric-cpu (macOS-11, fabric, 3.8, 1.13) success
fabric-cpu (ubuntu-20.04, fabric, 3.8, 1.13) success
fabric-cpu (windows-2022, fabric, 3.8, 1.13) success

These checks are required after the changes to src/lightning/fabric/accelerators/tpu.py, src/lightning/fabric/connector.py, src/lightning/fabric/plugins/environments/xla.py, src/lightning/fabric/strategies/single_device.py, src/lightning/fabric/strategies/single_tpu.py, src/lightning/fabric/utilities/device_parser.py, tests/tests_fabric/accelerators/test_tpu.py, tests/tests_fabric/conftest.py, tests/tests_fabric/plugins/environments/test_xla.py, tests/tests_fabric/strategies/test_xla.py, tests/tests_fabric/test_connector.py, tests/tests_fabric/test_fabric.py, tests/tests_fabric/utilities/test_device_parser.py.

🟢 lightning_fabric: Azure GPU
Check ID Status
lightning-fabric (GPUs) success

These checks are required after the changes to src/lightning/fabric/accelerators/tpu.py, src/lightning/fabric/connector.py, src/lightning/fabric/plugins/environments/xla.py, src/lightning/fabric/strategies/single_device.py, src/lightning/fabric/strategies/single_tpu.py, src/lightning/fabric/utilities/device_parser.py, tests/tests_fabric/accelerators/test_tpu.py, tests/tests_fabric/conftest.py, tests/tests_fabric/plugins/environments/test_xla.py, tests/tests_fabric/strategies/test_xla.py, tests/tests_fabric/test_connector.py, tests/tests_fabric/test_fabric.py, tests/tests_fabric/utilities/test_device_parser.py.

🟢 mypy
Check ID Status
mypy success

These checks are required after the changes to src/lightning/fabric/accelerators/tpu.py, src/lightning/fabric/connector.py, src/lightning/fabric/plugins/environments/xla.py, src/lightning/fabric/strategies/single_device.py, src/lightning/fabric/strategies/single_tpu.py, src/lightning/fabric/utilities/device_parser.py, src/lightning/pytorch/accelerators/tpu.py, src/lightning/pytorch/strategies/single_device.py, src/lightning/pytorch/strategies/single_tpu.py, src/lightning/pytorch/strategies/xla.py, src/lightning/pytorch/trainer/connectors/accelerator_connector.py.

🟢 install
Check ID Status
install-pkg (ubuntu-22.04, app, 3.8) success
install-pkg (ubuntu-22.04, app, 3.10) success
install-pkg (ubuntu-22.04, fabric, 3.8) success
install-pkg (ubuntu-22.04, fabric, 3.10) success
install-pkg (ubuntu-22.04, pytorch, 3.8) success
install-pkg (ubuntu-22.04, pytorch, 3.10) success
install-pkg (ubuntu-22.04, lightning, 3.8) success
install-pkg (ubuntu-22.04, lightning, 3.10) success
install-pkg (ubuntu-22.04, notset, 3.8) success
install-pkg (ubuntu-22.04, notset, 3.10) success
install-pkg (macOS-12, app, 3.8) success
install-pkg (macOS-12, app, 3.10) success
install-pkg (macOS-12, fabric, 3.8) success
install-pkg (macOS-12, fabric, 3.10) success
install-pkg (macOS-12, pytorch, 3.8) success
install-pkg (macOS-12, pytorch, 3.10) success
install-pkg (macOS-12, lightning, 3.8) success
install-pkg (macOS-12, lightning, 3.10) success
install-pkg (macOS-12, notset, 3.8) success
install-pkg (macOS-12, notset, 3.10) success
install-pkg (windows-2022, app, 3.8) success
install-pkg (windows-2022, app, 3.10) success
install-pkg (windows-2022, fabric, 3.8) success
install-pkg (windows-2022, fabric, 3.10) success
install-pkg (windows-2022, pytorch, 3.8) success
install-pkg (windows-2022, pytorch, 3.10) success
install-pkg (windows-2022, lightning, 3.8) success
install-pkg (windows-2022, lightning, 3.10) success
install-pkg (windows-2022, notset, 3.8) success
install-pkg (windows-2022, notset, 3.10) success

These checks are required after the changes to src/lightning/fabric/accelerators/tpu.py, src/lightning/fabric/connector.py, src/lightning/fabric/plugins/environments/xla.py, src/lightning/fabric/strategies/single_device.py, src/lightning/fabric/strategies/single_tpu.py, src/lightning/fabric/utilities/device_parser.py, src/lightning/pytorch/accelerators/tpu.py, src/lightning/pytorch/strategies/single_device.py, src/lightning/pytorch/strategies/single_tpu.py, src/lightning/pytorch/strategies/xla.py, src/lightning/pytorch/trainer/connectors/accelerator_connector.py.

🟢 link-check
Check ID Status
check-md-links / markdown-link-check success

These checks are required after the changes to src/lightning/fabric/CHANGELOG.md, src/lightning/pytorch/CHANGELOG.md.


Thank you for your contribution! 💜

Note
This comment is automatically generated and updates for 60 minutes every 180 seconds. If you have any other questions, contact carmocca for help.

@codecov
Copy link

codecov bot commented Mar 29, 2023

Codecov Report

Merging #17227 (b9ff9a7) into master (0c02c44) will decrease coverage by 9%.
The diff coverage is 84%.

Additional details and impacted files
@@            Coverage Diff            @@
##           master   #17227     +/-   ##
=========================================
- Coverage      68%      59%     -9%     
=========================================
  Files         433      410     -23     
  Lines       31659    31377    -282     
=========================================
- Hits        21626    18569   -3057     
- Misses      10033    12808   +2775     

src/lightning/fabric/accelerators/tpu.py Outdated Show resolved Hide resolved
src/lightning/pytorch/accelerators/tpu.py Show resolved Hide resolved
tests/tests_fabric/accelerators/test_tpu.py Show resolved Hide resolved
tests/tests_fabric/test_fabric.py Show resolved Hide resolved
tests/tests_pytorch/accelerators/test_tpu.py Show resolved Hide resolved
tests/tests_fabric/test_connector.py Show resolved Hide resolved
@carmocca carmocca changed the title TPU v4 support [TPU] v4 support Mar 30, 2023
@mergify mergify bot added the ready PRs ready to be merged label Apr 11, 2023
@carmocca carmocca enabled auto-merge (squash) April 11, 2023 19:14
@mergify mergify bot added has conflicts and removed ready PRs ready to be merged labels Apr 11, 2023
@mergify mergify bot added ready PRs ready to be merged and removed has conflicts ready PRs ready to be merged labels Apr 11, 2023
@carmocca carmocca merged commit 0489f2e into master Apr 11, 2023
@carmocca carmocca deleted the carmocca/tpu-env branch April 11, 2023 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accelerator: tpu Tensor Processing Unit fabric lightning.fabric.Fabric feature Is an improvement or enhancement pl Generic label for PyTorch Lightning package ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants