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

Rename PrecisionPlugin -> Precision #18840

Merged
merged 23 commits into from
Oct 30, 2023
Merged

Conversation

awaelchli
Copy link
Contributor

@awaelchli awaelchli commented Oct 23, 2023

What does this PR do?

Shortens the names and makes them consistent with Fabric.
Example:

from lightning.pytorch.plugins import BitsandbytesPrecisionPlugin

becomes

from lightning.pytorch.plugins import BitsandbytesPrecision

Backward-compatibility is preserved, you can still import all previous names without a warning. The request was raised by @lantiga.


📚 Documentation preview 📚: https://pytorch-lightning--18840.org.readthedocs.build/en/18840/

cc @Borda @justusschock @awaelchli @carmocca

@github-actions github-actions bot added docs Documentation related fabric lightning.fabric.Fabric pl Generic label for PyTorch Lightning package labels Oct 23, 2023
@awaelchli awaelchli added this to the 2.2 milestone Oct 23, 2023
@awaelchli awaelchli marked this pull request as ready for review October 23, 2023 23:24
@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2023

⚡ Required checks status: All passing 🟢

Groups summary

🟢 pytorch_lightning: Tests workflow
Check ID Status
pl-cpu (macOS-11, lightning, 3.8, 1.12, oldest) 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.10, 2.1) success
pl-cpu (ubuntu-20.04, lightning, 3.8, 1.12, oldest) 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.10, 2.1) success
pl-cpu (windows-2022, lightning, 3.8, 1.12, oldest) 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.10, 2.1) 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
pl-cpu (macOS-12, pytorch, 3.11, 2.0) success
pl-cpu (macOS-12, pytorch, 3.11, 2.1) success
pl-cpu (ubuntu-22.04, pytorch, 3.11, 2.0) success
pl-cpu (ubuntu-22.04, pytorch, 3.11, 2.1) success
pl-cpu (windows-2022, pytorch, 3.11, 2.0) success
pl-cpu (windows-2022, pytorch, 3.11, 2.1) success

These checks are required after the changes to src/lightning/fabric/plugins/precision/bitsandbytes.py, src/lightning/pytorch/_graveyard/__init__.py, src/lightning/pytorch/_graveyard/precision.py, src/lightning/pytorch/_graveyard/tpu.py, src/lightning/pytorch/callbacks/throughput_monitor.py, src/lightning/pytorch/plugins/__init__.py, src/lightning/pytorch/plugins/precision/__init__.py, src/lightning/pytorch/plugins/precision/amp.py, src/lightning/pytorch/plugins/precision/bitsandbytes.py, src/lightning/pytorch/plugins/precision/deepspeed.py, src/lightning/pytorch/plugins/precision/double.py, src/lightning/pytorch/plugins/precision/fsdp.py, src/lightning/pytorch/plugins/precision/half.py, src/lightning/pytorch/plugins/precision/precision.py, src/lightning/pytorch/plugins/precision/transformer_engine.py, src/lightning/pytorch/plugins/precision/xla.py, src/lightning/pytorch/strategies/ddp.py, src/lightning/pytorch/strategies/deepspeed.py, src/lightning/pytorch/strategies/fsdp.py, src/lightning/pytorch/strategies/parallel.py, src/lightning/pytorch/strategies/single_device.py, src/lightning/pytorch/strategies/single_xla.py, src/lightning/pytorch/strategies/strategy.py, src/lightning/pytorch/strategies/xla.py, src/lightning/pytorch/trainer/connectors/accelerator_connector.py, src/lightning/pytorch/trainer/connectors/checkpoint_connector.py, src/lightning/pytorch/trainer/trainer.py, tests/tests_pytorch/accelerators/test_cpu.py, tests/tests_pytorch/accelerators/test_xla.py, tests/tests_pytorch/deprecated_api/test_no_removal_version.py, tests/tests_pytorch/graveyard/__init__.py, tests/tests_pytorch/graveyard/test_precision.py, tests/tests_pytorch/models/test_ddp_fork_amp.py, tests/tests_pytorch/models/test_hooks.py, tests/tests_pytorch/plugins/precision/test_all.py, tests/tests_pytorch/plugins/precision/test_amp.py, tests/tests_pytorch/plugins/precision/test_amp_integration.py, tests/tests_pytorch/plugins/precision/test_deepspeed_precision.py, tests/tests_pytorch/plugins/precision/test_double.py, tests/tests_pytorch/plugins/precision/test_fsdp.py, tests/tests_pytorch/plugins/precision/test_half.py, tests/tests_pytorch/plugins/precision/test_transformer_engine.py, tests/tests_pytorch/plugins/precision/test_xla.py, tests/tests_pytorch/plugins/test_amp_plugins.py, tests/tests_pytorch/strategies/test_common.py, tests/tests_pytorch/strategies/test_ddp.py, tests/tests_pytorch/strategies/test_deepspeed.py, tests/tests_pytorch/strategies/test_fsdp.py, tests/tests_pytorch/trainer/connectors/test_accelerator_connector.py, tests/tests_pytorch/utilities/test_imports.py.

🟢 pytorch_lightning: Azure GPU
Check ID Status
pytorch-lightning (GPUs) (testing Lightning | latest) success
pytorch-lightning (GPUs) (testing PyTorch | latest) success

These checks are required after the changes to src/lightning/pytorch/_graveyard/__init__.py, src/lightning/pytorch/_graveyard/precision.py, src/lightning/pytorch/_graveyard/tpu.py, src/lightning/pytorch/callbacks/throughput_monitor.py, src/lightning/pytorch/plugins/__init__.py, src/lightning/pytorch/plugins/precision/__init__.py, src/lightning/pytorch/plugins/precision/amp.py, src/lightning/pytorch/plugins/precision/bitsandbytes.py, src/lightning/pytorch/plugins/precision/deepspeed.py, src/lightning/pytorch/plugins/precision/double.py, src/lightning/pytorch/plugins/precision/fsdp.py, src/lightning/pytorch/plugins/precision/half.py, src/lightning/pytorch/plugins/precision/precision.py, src/lightning/pytorch/plugins/precision/transformer_engine.py, src/lightning/pytorch/plugins/precision/xla.py, src/lightning/pytorch/strategies/ddp.py, src/lightning/pytorch/strategies/deepspeed.py, src/lightning/pytorch/strategies/fsdp.py, src/lightning/pytorch/strategies/parallel.py, src/lightning/pytorch/strategies/single_device.py, src/lightning/pytorch/strategies/single_xla.py, src/lightning/pytorch/strategies/strategy.py, src/lightning/pytorch/strategies/xla.py, src/lightning/pytorch/trainer/connectors/accelerator_connector.py, src/lightning/pytorch/trainer/connectors/checkpoint_connector.py, src/lightning/pytorch/trainer/trainer.py, tests/tests_pytorch/accelerators/test_cpu.py, tests/tests_pytorch/accelerators/test_xla.py, tests/tests_pytorch/deprecated_api/test_no_removal_version.py, tests/tests_pytorch/graveyard/__init__.py, tests/tests_pytorch/graveyard/test_precision.py, tests/tests_pytorch/models/test_ddp_fork_amp.py, tests/tests_pytorch/models/test_hooks.py, tests/tests_pytorch/plugins/precision/test_all.py, tests/tests_pytorch/plugins/precision/test_amp.py, tests/tests_pytorch/plugins/precision/test_amp_integration.py, tests/tests_pytorch/plugins/precision/test_deepspeed_precision.py, tests/tests_pytorch/plugins/precision/test_double.py, tests/tests_pytorch/plugins/precision/test_fsdp.py, tests/tests_pytorch/plugins/precision/test_half.py, tests/tests_pytorch/plugins/precision/test_transformer_engine.py, tests/tests_pytorch/plugins/precision/test_xla.py, tests/tests_pytorch/plugins/test_amp_plugins.py, tests/tests_pytorch/strategies/test_common.py, tests/tests_pytorch/strategies/test_ddp.py, tests/tests_pytorch/strategies/test_deepspeed.py, tests/tests_pytorch/strategies/test_fsdp.py, tests/tests_pytorch/trainer/connectors/test_accelerator_connector.py, tests/tests_pytorch/utilities/test_imports.py, src/lightning/fabric/plugins/precision/bitsandbytes.py.

🟢 pytorch_lightning: Benchmarks
Check ID Status
lightning.Benchmarks success

These checks are required after the changes to src/lightning/fabric/plugins/precision/bitsandbytes.py, src/lightning/pytorch/_graveyard/__init__.py, src/lightning/pytorch/_graveyard/precision.py, src/lightning/pytorch/_graveyard/tpu.py, src/lightning/pytorch/callbacks/throughput_monitor.py, src/lightning/pytorch/plugins/__init__.py, src/lightning/pytorch/plugins/precision/__init__.py, src/lightning/pytorch/plugins/precision/amp.py, src/lightning/pytorch/plugins/precision/bitsandbytes.py, src/lightning/pytorch/plugins/precision/deepspeed.py, src/lightning/pytorch/plugins/precision/double.py, src/lightning/pytorch/plugins/precision/fsdp.py, src/lightning/pytorch/plugins/precision/half.py, src/lightning/pytorch/plugins/precision/precision.py, src/lightning/pytorch/plugins/precision/transformer_engine.py, src/lightning/pytorch/plugins/precision/xla.py, src/lightning/pytorch/strategies/ddp.py, src/lightning/pytorch/strategies/deepspeed.py, src/lightning/pytorch/strategies/fsdp.py, src/lightning/pytorch/strategies/parallel.py, src/lightning/pytorch/strategies/single_device.py, src/lightning/pytorch/strategies/single_xla.py, src/lightning/pytorch/strategies/strategy.py, src/lightning/pytorch/strategies/xla.py, src/lightning/pytorch/trainer/connectors/accelerator_connector.py, src/lightning/pytorch/trainer/connectors/checkpoint_connector.py, src/lightning/pytorch/trainer/trainer.py.

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

These checks are required after the changes to src/lightning/fabric/plugins/precision/bitsandbytes.py.

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

These checks are required after the changes to src/lightning/pytorch/_graveyard/__init__.py, src/lightning/pytorch/_graveyard/precision.py, src/lightning/pytorch/_graveyard/tpu.py, src/lightning/pytorch/callbacks/throughput_monitor.py, src/lightning/pytorch/plugins/__init__.py, src/lightning/pytorch/plugins/precision/__init__.py, src/lightning/pytorch/plugins/precision/amp.py, src/lightning/pytorch/plugins/precision/bitsandbytes.py, src/lightning/pytorch/plugins/precision/deepspeed.py, src/lightning/pytorch/plugins/precision/double.py, src/lightning/pytorch/plugins/precision/fsdp.py, src/lightning/pytorch/plugins/precision/half.py, src/lightning/pytorch/plugins/precision/precision.py, src/lightning/pytorch/plugins/precision/transformer_engine.py, src/lightning/pytorch/plugins/precision/xla.py, src/lightning/pytorch/strategies/ddp.py, src/lightning/pytorch/strategies/deepspeed.py, src/lightning/pytorch/strategies/fsdp.py, src/lightning/pytorch/strategies/parallel.py, src/lightning/pytorch/strategies/single_device.py, src/lightning/pytorch/strategies/single_xla.py, src/lightning/pytorch/strategies/strategy.py, src/lightning/pytorch/strategies/xla.py, src/lightning/pytorch/trainer/connectors/accelerator_connector.py, src/lightning/pytorch/trainer/connectors/checkpoint_connector.py, src/lightning/pytorch/trainer/trainer.py, docs/source-pytorch/api_references.rst, docs/source-pytorch/common/precision_expert.rst, docs/source-pytorch/common/precision_intermediate.rst, docs/source-pytorch/extensions/plugins.rst.

🟢 lightning_fabric: CPU workflow
Check ID Status
fabric-cpu (macOS-11, lightning, 3.8, 1.12, oldest) 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.11, 2.1) success
fabric-cpu (ubuntu-20.04, lightning, 3.8, 1.12, oldest) 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.11, 2.1) success
fabric-cpu (windows-2022, lightning, 3.8, 1.12, oldest) 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.11, 2.1) 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
fabric-cpu (macOS-12, fabric, 3.11, 2.0) success
fabric-cpu (macOS-12, fabric, 3.11, 2.1) success
fabric-cpu (ubuntu-22.04, fabric, 3.11, 2.0) success
fabric-cpu (ubuntu-22.04, fabric, 3.11, 2.1) success
fabric-cpu (windows-2022, fabric, 3.11, 2.0) success
fabric-cpu (windows-2022, fabric, 3.11, 2.1) success

These checks are required after the changes to src/lightning/fabric/plugins/precision/bitsandbytes.py, tests/tests_fabric/plugins/collectives/test_torch_collective.py.

🟢 lightning_fabric: Azure GPU
Check ID Status
lightning-fabric (GPUs) (testing Fabric | latest) success
lightning-fabric (GPUs) (testing Lightning | latest) success

These checks are required after the changes to src/lightning/fabric/plugins/precision/bitsandbytes.py, tests/tests_fabric/plugins/collectives/test_torch_collective.py.

🟢 mypy
Check ID Status
mypy success

These checks are required after the changes to src/lightning/fabric/plugins/precision/bitsandbytes.py, src/lightning/pytorch/_graveyard/__init__.py, src/lightning/pytorch/_graveyard/precision.py, src/lightning/pytorch/_graveyard/tpu.py, src/lightning/pytorch/callbacks/throughput_monitor.py, src/lightning/pytorch/plugins/__init__.py, src/lightning/pytorch/plugins/precision/__init__.py, src/lightning/pytorch/plugins/precision/amp.py, src/lightning/pytorch/plugins/precision/bitsandbytes.py, src/lightning/pytorch/plugins/precision/deepspeed.py, src/lightning/pytorch/plugins/precision/double.py, src/lightning/pytorch/plugins/precision/fsdp.py, src/lightning/pytorch/plugins/precision/half.py, src/lightning/pytorch/plugins/precision/precision.py, src/lightning/pytorch/plugins/precision/transformer_engine.py, src/lightning/pytorch/plugins/precision/xla.py, src/lightning/pytorch/strategies/ddp.py, src/lightning/pytorch/strategies/deepspeed.py, src/lightning/pytorch/strategies/fsdp.py, src/lightning/pytorch/strategies/parallel.py, src/lightning/pytorch/strategies/single_device.py, src/lightning/pytorch/strategies/single_xla.py, src/lightning/pytorch/strategies/strategy.py, src/lightning/pytorch/strategies/xla.py, src/lightning/pytorch/trainer/connectors/accelerator_connector.py, src/lightning/pytorch/trainer/connectors/checkpoint_connector.py, src/lightning/pytorch/trainer/trainer.py.

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

These checks are required after the changes to src/lightning/fabric/plugins/precision/bitsandbytes.py, src/lightning/pytorch/_graveyard/__init__.py, src/lightning/pytorch/_graveyard/precision.py, src/lightning/pytorch/_graveyard/tpu.py, src/lightning/pytorch/callbacks/throughput_monitor.py, src/lightning/pytorch/plugins/__init__.py, src/lightning/pytorch/plugins/precision/__init__.py, src/lightning/pytorch/plugins/precision/amp.py, src/lightning/pytorch/plugins/precision/bitsandbytes.py, src/lightning/pytorch/plugins/precision/deepspeed.py, src/lightning/pytorch/plugins/precision/double.py, src/lightning/pytorch/plugins/precision/fsdp.py, src/lightning/pytorch/plugins/precision/half.py, src/lightning/pytorch/plugins/precision/precision.py, src/lightning/pytorch/plugins/precision/transformer_engine.py, src/lightning/pytorch/plugins/precision/xla.py, src/lightning/pytorch/strategies/ddp.py, src/lightning/pytorch/strategies/deepspeed.py, src/lightning/pytorch/strategies/fsdp.py, src/lightning/pytorch/strategies/parallel.py, src/lightning/pytorch/strategies/single_device.py, src/lightning/pytorch/strategies/single_xla.py, src/lightning/pytorch/strategies/strategy.py, src/lightning/pytorch/strategies/xla.py, src/lightning/pytorch/trainer/connectors/accelerator_connector.py, src/lightning/pytorch/trainer/connectors/checkpoint_connector.py, src/lightning/pytorch/trainer/trainer.py.


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.

Copy link
Contributor

@carmocca carmocca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has there been any discussion about adding a deprecation message? (even if there's no removal date)

How will users know that they need to upgrade? Simply by looking at the newest docs?

src/lightning/pytorch/plugins/__init__.py Outdated Show resolved Hide resolved
src/lightning/pytorch/_graveyard/__init__.py Show resolved Hide resolved
src/lightning/pytorch/_graveyard/precision.py Show resolved Hide resolved
@awaelchli
Copy link
Contributor Author

Hey @lantiga could you tell us if you want a deprecation message for the old name, or not?

@awaelchli awaelchli added the fun Staff contributions outside working hours - to differentiate from the "community" label label Oct 28, 2023
@Borda
Copy link
Member

Borda commented Oct 28, 2023

Hey @lantiga could you tell us if you want a deprecation message for the old name, or not?

I would suggest having it

@lantiga
Copy link
Collaborator

lantiga commented Oct 29, 2023

Ok let’s add the deprecation message, and let’s include this in the next patch release.

We won’t remove for the foreseeable future.

@awaelchli awaelchli requested a review from carmocca October 29, 2023 03:26
@awaelchli awaelchli modified the milestones: 2.2, 2.1.x Oct 29, 2023
@mergify mergify bot added the ready PRs ready to be merged label Oct 30, 2023
Copy link
Contributor

@carmocca carmocca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a heads up for conflicts with #18848

src/lightning/pytorch/_graveyard/precision.py Show resolved Hide resolved
@awaelchli awaelchli force-pushed the refactor/precision-plugin-name branch from a827012 to 4eb40d3 Compare October 30, 2023 17:45
@awaelchli awaelchli requested a review from carmocca October 30, 2023 18:11
@awaelchli awaelchli merged commit 079544a into master Oct 30, 2023
117 checks passed
@awaelchli awaelchli deleted the refactor/precision-plugin-name branch October 30, 2023 20:53
awaelchli added a commit that referenced this pull request Nov 3, 2023
Borda pushed a commit that referenced this pull request Nov 3, 2023
lantiga pushed a commit that referenced this pull request Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation related fabric lightning.fabric.Fabric fun Staff contributions outside working hours - to differentiate from the "community" label pl Generic label for PyTorch Lightning package plugin ready PRs ready to be merged refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants