diff --git a/.github/actions/pkg-publish/action.yml b/.github/actions/pkg-publish/action.yml deleted file mode 100644 index 183160b98a6c2..0000000000000 --- a/.github/actions/pkg-publish/action.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Publish package -description: publishing whl and src to PyPI - -inputs: - pkg-folder: - description: define folder with packages - required: true - pypi-test-token: - description: login token for PyPI - default: "" - required: false - pypi-token: - description: login token for PyPI - default: "" - required: false - -runs: - using: "composite" - steps: - - run: ls -lh ${{ inputs.pkg-folder }} - shell: bash - - # We do this, since failures on test.pypi aren't that bad - - name: Publish to Test PyPI - uses: pypa/gh-action-pypi-publish@v1.5.1 - if: inputs.pypi-test-token != '' - with: - user: __token__ - password: ${{ inputs.pypi-test-token }} - repository_url: https://test.pypi.org/legacy/ - packages_dir: ${{ inputs.pkg-folder }} - verbose: true - - - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@v1.5.1 - if: inputs.pypi-token != '' - with: - user: __token__ - password: ${{ inputs.pypi-token }} - packages_dir: ${{ inputs.pkg-folder }} - verbose: true diff --git a/.github/workflows/label-conflicts.yml b/.github/workflows/label-conflicts.yml index 06a809c48b541..1291bb74c5bc2 100644 --- a/.github/workflows/label-conflicts.yml +++ b/.github/workflows/label-conflicts.yml @@ -14,7 +14,7 @@ jobs: triage-conflicts: runs-on: ubuntu-latest steps: - - uses: mschilde/auto-label-merge-conflicts@591722e97f3c4142df3eca156ed0dcf2bcd362bd # Oct 25, 2021 + - uses: mschilde/auto-label-merge-conflicts@cd484bbf0476fbe79474a937681a253e094cac3d # May 9, 2026 with: CONFLICT_LABEL_NAME: "has conflicts" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml index db12b6d7627aa..eb78fe5ed1b82 100644 --- a/.github/workflows/release-nightly.yml +++ b/.github/workflows/release-nightly.yml @@ -7,7 +7,6 @@ on: paths: - "requirements/ci.txt" - ".github/actions/pkg-check/*" - - ".github/actions/pkg-publish/*" - ".github/workflows/release-nightly.yml" schedule: - cron: "0 0 * * 0" # on Sundays @@ -45,24 +44,3 @@ jobs: name: nightly-packages-${{ github.sha }} path: dist include-hidden-files: true - - publish-packages: - runs-on: ubuntu-22.04 - needs: build-packages - if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' - env: - PKG_NAME: "lightning" - steps: - - uses: actions/checkout@v6 # needed to use local composite action - - uses: actions/download-artifact@v8 - with: - name: nightly-packages-${{ github.sha }} - path: dist - - uses: ./.github/actions/pkg-publish - with: - pkg-folder: dist - pypi-test-token: ${{ secrets[format('PYPI_TEST_TOKEN_{0}', env.PKG_NAME)] }} - - uses: ./.github/actions/pkg-publish - with: - pkg-folder: dist - pypi-token: ${{ secrets[format('PYPI_TOKEN_{0}', env.PKG_NAME)] }} diff --git a/.github/workflows/release-pkg.yml b/.github/workflows/release-pkg.yml index 476ed531259e7..ae8cde524a05e 100644 --- a/.github/workflows/release-pkg.yml +++ b/.github/workflows/release-pkg.yml @@ -12,7 +12,6 @@ on: paths: - "requirements/ci.txt" - ".github/actions/pkg-check/*" - - ".github/actions/pkg-publish/*" - ".github/workflows/_legacy-checkpoints.yml" - ".github/workflows/_build-packages.yml" - ".github/workflows/release-pypi.yml" @@ -130,35 +129,12 @@ jobs: ethanwharris borda - pre-publish-packages: - runs-on: ubuntu-22.04 - needs: build-packages - if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' - strategy: - fail-fast: false - matrix: - name: ["FABRIC", "PYTORCH", "LIGHTNING"] - steps: - - uses: actions/checkout@v6 # needed for local action below - - uses: actions/download-artifact@v8 - with: - name: dist-packages-${{ github.sha }} - path: dist - - name: Browse folder - id: folder - run: | - sudo apt install -q -y tree - tree -L 2 -h dist/ - python -c "print('pkg=' + '${{ matrix.name }}'.lower())" >> $GITHUB_OUTPUT - - uses: ./.github/actions/pkg-publish - with: - pkg-folder: dist/${{ steps.folder.outputs.pkg }} - pypi-test-token: ${{ secrets[format('PYPI_TEST_TOKEN_{0}', matrix.name)] }} - publish-packages: runs-on: ubuntu-22.04 needs: [build-packages] if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' + permissions: + id-token: write strategy: fail-fast: false matrix: @@ -175,10 +151,12 @@ jobs: sudo apt install -q -y tree tree -L 2 -h dist/ python -c "print('pkg=' + '${{ matrix.name }}'.lower())" >> $GITHUB_OUTPUT - - uses: ./.github/actions/pkg-publish + + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@v1.5.1 with: - pkg-folder: dist/${{ steps.folder.outputs.pkg }} - pypi-token: ${{ secrets[format('PYPI_TOKEN_{0}', matrix.name)] }} + packages_dir: dist/${{ steps.folder.outputs.pkg }} + verbose: true legacy-checkpoints: needs: [build-packages] diff --git a/src/lightning/pytorch/core/module.py b/src/lightning/pytorch/core/module.py index e5279e51887bf..9c09aee4a8f24 100644 --- a/src/lightning/pytorch/core/module.py +++ b/src/lightning/pytorch/core/module.py @@ -1498,11 +1498,10 @@ def to_torchscript( example_inputs: Optional[Any] = None, **kwargs: Any, ) -> Union[ScriptModule, dict[str, ScriptModule]]: - """By default compiles the whole model to a :class:`~torch.jit.ScriptModule`. If you want to use tracing, - please provided the argument ``method='trace'`` and make sure that either the `example_inputs` argument is - provided, or the model has :attr:`example_input_array` set. If you would like to customize the modules that are - scripted you should override this method. In case you want to return multiple modules, we recommend using a - dictionary. + """By default compiles the whole model to a ``torch.jit.ScriptModule``. If you want to use tracing, please + provided the argument ``method='trace'`` and make sure that either the `example_inputs` argument is provided, + or the model has :attr:`example_input_array` set. If you would like to customize the modules that are scripted + you should override this method. In case you want to return multiple modules, we recommend using a dictionary. .. deprecated:: ``LightningModule.to_torchscript`` has been deprecated in v2.7 and will be removed in v2.8. @@ -1514,15 +1513,15 @@ def to_torchscript( method: Whether to use TorchScript's script or trace method. Default: 'script' example_inputs: An input to be used to do tracing when method is set to 'trace'. Default: None (uses :attr:`example_input_array`) - **kwargs: Additional arguments that will be passed to the :func:`torch.jit.script` or - :func:`torch.jit.trace` function. + **kwargs: Additional arguments that will be passed to the ``torch.jit.script`` or + ``torch.jit.trace`` function. Note: - Requires the implementation of the :meth:`~lightning.pytorch.core.LightningModule.forward` method. - The exported script will be set to evaluation mode. - It is recommended that you install the latest supported version of PyTorch - to use this feature without limitations. See also the :mod:`torch.jit` + to use this feature without limitations. See also the ``torch.jit`` documentation for supported features. Example:: diff --git a/src/version.info b/src/version.info index 097a15a2af39d..2714f5313ae11 100644 --- a/src/version.info +++ b/src/version.info @@ -1 +1 @@ -2.6.2 +2.6.4