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

Remove the "native" suffix from the codebase #16490

Merged
merged 7 commits into from
Jan 25, 2023
Merged

Conversation

carmocca
Copy link
Contributor

@carmocca carmocca commented Jan 24, 2023

What does this PR do?

See title. This is consistent with Fabric

Fixes #14186

Does your PR introduce any breaking changes? If yes, please list them.

  • strategy="fsdp_native" -> strategy="fsdp"
  • (pl) strategy="fsdp_native_full_shard_offload" -> strategy="fsdp_cpu_offload"
  • (fabric) strategy="fsdp_full_shard_offload" -> strategy="fsdp_cpu_offload"
  • pytorch_lightning.strategies.fully_sharded_native.DDPFullyShardedNativeStrategy -> pytorch_lightning.strategies.fsdp.FSDPStrategy
  • pytorch_lightning.plugins.precision.fsdp_native_native_amp.FullyShardedNativeNativeMixedPrecisionPlugin -> pytorch_lightning.plugins.precision.fsdp.FSDPMixedPrecisionPlugin
  • pytorch_lightning.plugins.precision.native_amp -> pytorch_lightning.plugins.precision.amp
  • lightning_fabric.plugins.precision.native_amp -> lightning_fabric.plugins.precision.amp
  • NativeSyncBatchNorm -> TorchSyncBatchNorm

cc @justusschock @awaelchli @Borda @carmocca

@carmocca carmocca added refactor breaking change Includes a breaking change precision: amp Automatic Mixed Precision strategy: fsdp Fully Sharded Data Parallel pl Generic label for PyTorch Lightning package labels Jan 24, 2023
@carmocca carmocca added this to the 2.0 milestone Jan 24, 2023
@carmocca carmocca self-assigned this Jan 24, 2023
@carmocca carmocca marked this pull request as ready for review January 25, 2023 00:10
@github-actions
Copy link
Contributor

github-actions bot commented Jan 25, 2023

⚡ Required checks status: All passing 🟢

Groups summary

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

These checks are required after the changes to src/lightning_fabric/connector.py, src/lightning_fabric/plugins/__init__.py, src/lightning_fabric/plugins/precision/__init__.py, src/lightning_fabric/plugins/precision/amp.py, src/lightning_fabric/plugins/precision/fsdp.py, src/lightning_fabric/strategies/fsdp.py, src/pytorch_lightning/callbacks/stochastic_weight_avg.py, src/pytorch_lightning/core/hooks.py, src/pytorch_lightning/plugins/__init__.py, src/pytorch_lightning/plugins/layer_sync.py, src/pytorch_lightning/plugins/precision/__init__.py, src/pytorch_lightning/plugins/precision/amp.py, src/pytorch_lightning/plugins/precision/fsdp.py, src/pytorch_lightning/serve/servable_module_validator.py, src/pytorch_lightning/strategies/__init__.py, src/pytorch_lightning/strategies/fsdp.py, src/pytorch_lightning/trainer/connectors/accelerator_connector.py, src/pytorch_lightning/trainer/trainer.py, tests/tests_pytorch/callbacks/test_stochastic_weight_avg.py, tests/tests_pytorch/models/test_ddp_fork_amp.py, tests/tests_pytorch/plugins/precision/test_amp.py, tests/tests_pytorch/plugins/precision/test_amp_integration.py, tests/tests_pytorch/plugins/test_amp_plugins.py, tests/tests_pytorch/strategies/test_fsdp.py, tests/tests_pytorch/strategies/test_registry.py, tests/tests_pytorch/trainer/connectors/test_accelerator_connector.py, tests/tests_pytorch/trainer/optimization/test_manual_optimization.py, tests/tests_pytorch/trainer/test_trainer.py, tests/tests_pytorch/utilities/test_imports.py.

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

These checks are required after the changes to src/pytorch_lightning/callbacks/stochastic_weight_avg.py, src/pytorch_lightning/core/hooks.py, src/pytorch_lightning/plugins/__init__.py, src/pytorch_lightning/plugins/layer_sync.py, src/pytorch_lightning/plugins/precision/__init__.py, src/pytorch_lightning/plugins/precision/amp.py, src/pytorch_lightning/plugins/precision/fsdp.py, src/pytorch_lightning/serve/servable_module_validator.py, src/pytorch_lightning/strategies/__init__.py, src/pytorch_lightning/strategies/fsdp.py, src/pytorch_lightning/trainer/connectors/accelerator_connector.py, src/pytorch_lightning/trainer/trainer.py, tests/tests_pytorch/callbacks/test_stochastic_weight_avg.py, tests/tests_pytorch/models/test_ddp_fork_amp.py, tests/tests_pytorch/plugins/precision/test_amp.py, tests/tests_pytorch/plugins/precision/test_amp_integration.py, tests/tests_pytorch/plugins/test_amp_plugins.py, tests/tests_pytorch/strategies/test_fsdp.py, tests/tests_pytorch/strategies/test_registry.py, tests/tests_pytorch/trainer/connectors/test_accelerator_connector.py, tests/tests_pytorch/trainer/optimization/test_manual_optimization.py, tests/tests_pytorch/trainer/test_trainer.py, tests/tests_pytorch/utilities/test_imports.py, src/lightning_fabric/connector.py, src/lightning_fabric/plugins/__init__.py, src/lightning_fabric/plugins/precision/__init__.py, src/lightning_fabric/plugins/precision/amp.py, src/lightning_fabric/plugins/precision/fsdp.py, src/lightning_fabric/strategies/fsdp.py.

🟢 pytorch_lightning: Azure HPU
Check ID Status
pytorch-lightning (HPUs) success

These checks are required after the changes to src/lightning_fabric/connector.py, src/lightning_fabric/plugins/__init__.py, src/lightning_fabric/plugins/precision/__init__.py, src/lightning_fabric/plugins/precision/amp.py, src/lightning_fabric/plugins/precision/fsdp.py, src/lightning_fabric/strategies/fsdp.py, src/pytorch_lightning/callbacks/stochastic_weight_avg.py, src/pytorch_lightning/core/hooks.py, src/pytorch_lightning/plugins/__init__.py, src/pytorch_lightning/plugins/layer_sync.py, src/pytorch_lightning/plugins/precision/__init__.py, src/pytorch_lightning/plugins/precision/amp.py, src/pytorch_lightning/plugins/precision/fsdp.py, src/pytorch_lightning/serve/servable_module_validator.py, src/pytorch_lightning/strategies/__init__.py, src/pytorch_lightning/strategies/fsdp.py, src/pytorch_lightning/trainer/connectors/accelerator_connector.py, src/pytorch_lightning/trainer/trainer.py, tests/tests_pytorch/callbacks/test_stochastic_weight_avg.py, tests/tests_pytorch/models/test_ddp_fork_amp.py, tests/tests_pytorch/plugins/precision/test_amp.py, tests/tests_pytorch/plugins/precision/test_amp_integration.py, tests/tests_pytorch/plugins/test_amp_plugins.py, tests/tests_pytorch/strategies/test_fsdp.py, tests/tests_pytorch/strategies/test_registry.py, tests/tests_pytorch/trainer/connectors/test_accelerator_connector.py, tests/tests_pytorch/trainer/optimization/test_manual_optimization.py, tests/tests_pytorch/trainer/test_trainer.py, tests/tests_pytorch/utilities/test_imports.py.

🟢 pytorch_lightning: Azure IPU
Check ID Status
pytorch-lightning (IPUs) success

These checks are required after the changes to src/lightning_fabric/connector.py, src/lightning_fabric/plugins/__init__.py, src/lightning_fabric/plugins/precision/__init__.py, src/lightning_fabric/plugins/precision/amp.py, src/lightning_fabric/plugins/precision/fsdp.py, src/lightning_fabric/strategies/fsdp.py, src/pytorch_lightning/callbacks/stochastic_weight_avg.py, src/pytorch_lightning/core/hooks.py, src/pytorch_lightning/plugins/__init__.py, src/pytorch_lightning/plugins/layer_sync.py, src/pytorch_lightning/plugins/precision/__init__.py, src/pytorch_lightning/plugins/precision/amp.py, src/pytorch_lightning/plugins/precision/fsdp.py, src/pytorch_lightning/serve/servable_module_validator.py, src/pytorch_lightning/strategies/__init__.py, src/pytorch_lightning/strategies/fsdp.py, src/pytorch_lightning/trainer/connectors/accelerator_connector.py, src/pytorch_lightning/trainer/trainer.py, tests/tests_pytorch/callbacks/test_stochastic_weight_avg.py, tests/tests_pytorch/models/test_ddp_fork_amp.py, tests/tests_pytorch/plugins/precision/test_amp.py, tests/tests_pytorch/plugins/precision/test_amp_integration.py, tests/tests_pytorch/plugins/test_amp_plugins.py, tests/tests_pytorch/strategies/test_fsdp.py, tests/tests_pytorch/strategies/test_registry.py, tests/tests_pytorch/trainer/connectors/test_accelerator_connector.py, tests/tests_pytorch/trainer/optimization/test_manual_optimization.py, tests/tests_pytorch/trainer/test_trainer.py, tests/tests_pytorch/utilities/test_imports.py.

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

These checks are required after the changes to src/pytorch_lightning/callbacks/stochastic_weight_avg.py, src/pytorch_lightning/core/hooks.py, src/pytorch_lightning/plugins/__init__.py, src/pytorch_lightning/plugins/layer_sync.py, src/pytorch_lightning/plugins/precision/__init__.py, src/pytorch_lightning/plugins/precision/amp.py, src/pytorch_lightning/plugins/precision/fsdp.py, src/pytorch_lightning/serve/servable_module_validator.py, src/pytorch_lightning/strategies/__init__.py, src/pytorch_lightning/strategies/fsdp.py, src/pytorch_lightning/trainer/connectors/accelerator_connector.py, src/pytorch_lightning/trainer/trainer.py, docs/source-pytorch/advanced/model_parallel.rst, docs/source-pytorch/api_references.rst, docs/source-pytorch/extensions/plugins.rst, docs/source-pytorch/extensions/strategy.rst, docs/source-pytorch/guides/speed.rst.

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

These checks are required after the changes to src/lightning_fabric/connector.py, src/lightning_fabric/plugins/__init__.py, src/lightning_fabric/plugins/precision/__init__.py, src/lightning_fabric/plugins/precision/amp.py, src/lightning_fabric/plugins/precision/fsdp.py, src/lightning_fabric/strategies/fsdp.py, tests/tests_fabric/plugins/precision/test_amp.py, tests/tests_fabric/plugins/precision/test_amp_integration.py, tests/tests_fabric/strategies/test_registry.py, tests/tests_fabric/test_connector.py.

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

These checks are required after the changes to src/lightning_fabric/connector.py, src/lightning_fabric/plugins/__init__.py, src/lightning_fabric/plugins/precision/__init__.py, src/lightning_fabric/plugins/precision/amp.py, src/lightning_fabric/plugins/precision/fsdp.py, src/lightning_fabric/strategies/fsdp.py, tests/tests_fabric/plugins/precision/test_amp.py, tests/tests_fabric/plugins/precision/test_amp_integration.py, tests/tests_fabric/strategies/test_registry.py, tests/tests_fabric/test_connector.py.

🟢 mypy
Check ID Status
mypy success

These checks are required after the changes to src/lightning_fabric/connector.py, src/lightning_fabric/plugins/__init__.py, src/lightning_fabric/plugins/precision/__init__.py, src/lightning_fabric/plugins/precision/amp.py, src/lightning_fabric/plugins/precision/fsdp.py, src/lightning_fabric/strategies/fsdp.py, src/pytorch_lightning/callbacks/stochastic_weight_avg.py, src/pytorch_lightning/core/hooks.py, src/pytorch_lightning/plugins/__init__.py, src/pytorch_lightning/plugins/layer_sync.py, src/pytorch_lightning/plugins/precision/__init__.py, src/pytorch_lightning/plugins/precision/amp.py, src/pytorch_lightning/plugins/precision/fsdp.py, src/pytorch_lightning/serve/servable_module_validator.py, src/pytorch_lightning/strategies/__init__.py, src/pytorch_lightning/strategies/fsdp.py, src/pytorch_lightning/trainer/connectors/accelerator_connector.py, src/pytorch_lightning/trainer/trainer.py.

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

These checks are required after the changes to src/lightning_fabric/connector.py, src/lightning_fabric/plugins/__init__.py, src/lightning_fabric/plugins/precision/__init__.py, src/lightning_fabric/plugins/precision/amp.py, src/lightning_fabric/plugins/precision/fsdp.py, src/lightning_fabric/strategies/fsdp.py, src/pytorch_lightning/callbacks/stochastic_weight_avg.py, src/pytorch_lightning/core/hooks.py, src/pytorch_lightning/plugins/__init__.py, src/pytorch_lightning/plugins/layer_sync.py, src/pytorch_lightning/plugins/precision/__init__.py, src/pytorch_lightning/plugins/precision/amp.py, src/pytorch_lightning/plugins/precision/fsdp.py, src/pytorch_lightning/serve/servable_module_validator.py, src/pytorch_lightning/strategies/__init__.py, src/pytorch_lightning/strategies/fsdp.py, src/pytorch_lightning/trainer/connectors/accelerator_connector.py, src/pytorch_lightning/trainer/trainer.py.

🟢 link-check
Check ID Status
markdown-link-check success

These checks are required after the changes to src/lightning_fabric/CHANGELOG.md, src/pytorch_lightning/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.

tests/tests_pytorch/strategies/test_fsdp.py Outdated Show resolved Hide resolved
@mergify mergify bot added ready PRs ready to be merged has conflicts and removed ready PRs ready to be merged labels Jan 25, 2023
@github-actions github-actions bot added the fabric lightning.fabric.Fabric label Jan 25, 2023
@mergify mergify bot added ready PRs ready to be merged and removed has conflicts labels Jan 25, 2023
@mergify mergify bot added ready PRs ready to be merged has conflicts and removed ready PRs ready to be merged labels Jan 25, 2023
@mergify mergify bot added ready PRs ready to be merged and removed has conflicts ready PRs ready to be merged labels Jan 25, 2023
@carmocca carmocca enabled auto-merge (squash) January 25, 2023 14:05
@carmocca carmocca merged commit d78cf99 into master Jan 25, 2023
@carmocca carmocca deleted the refactor/native-purge branch January 25, 2023 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Includes a breaking change fabric lightning.fabric.Fabric pl Generic label for PyTorch Lightning package precision: amp Automatic Mixed Precision ready PRs ready to be merged refactor strategy: fsdp Fully Sharded Data Parallel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC] Rename the fsdp strategy to FairscaleFSDP since we have fsdp native now.
4 participants