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

Add lightning #22249

Merged
merged 12 commits into from
Apr 6, 2023
Merged

Add lightning #22249

merged 12 commits into from
Apr 6, 2023

Conversation

weiji14
Copy link
Member

@weiji14 weiji14 commented Mar 8, 2023

Use Lightning Apps to build everything from production-ready, multi-cloud ML systems to simple research demos! Repo at https://github.com/Lightning-AI/lightning

Xref previous attempts at #19716 and #19715. Requires #22247.

Checklist

  • Title of this PR is meaningful: e.g. "Adding my_nifty_package", not "updated meta.yaml".
  • License file is packaged (see here for an example).
  • Source is from official source.
  • Package does not vendor other packages. (If a package uses the source of another package, they should be separate packages or the licenses of all packages need to be packaged).
  • If static libraries are linked in, the license of the static library is packaged.
  • Package does not ship static libraries. If static libraries are needed, follow CFEP-18.
  • Build number is 0.
  • A tarball (url) rather than a repo (e.g. git_url) is used in your recipe (see here for more details).
  • GitHub users listed in the maintainer section have posted a comment confirming they are willing to be listed there.
  • When in trouble, please check our knowledge base documentation before pinging a team.

Use Lightning Apps to build everything from production-ready, multi-cloud ML systems to simple research demos! Repo at https://github.com/Lightning-AI/lightning
@conda-forge-webservices
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipes/lightning) and found it was in an excellent condition.

I do have some suggestions for making it better though...

For recipes/lightning:

  • Recipe with the same name exists in bioconda: please discuss with @conda-forge/bioconda-recipes.

recipes/lightning/meta.yaml Outdated Show resolved Hide resolved
@weiji14
Copy link
Member Author

weiji14 commented Mar 8, 2023

For recipes/lightning:

* Recipe with the same name exists in bioconda: please discuss with @conda-forge/bioconda-recipes.

Discussion at https://github.com/orgs/conda-forge/teams/bioconda-recipes/discussions/15

@weiji14
Copy link
Member Author

weiji14 commented Mar 12, 2023

Build failing at https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=671385&view=logs&j=6f142865-96c3-535c-b7ea-873d86b887bd&t=22b0682d-ab9e-55d7-9c79-49f3c3ba4823&l=3700 as follows:

export PREFIX=/home/conda/staged-recipes/build_artifacts/lightning_1678550325764/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh
export SRC_DIR=/home/conda/staged-recipes/build_artifacts/lightning_1678550325764/test_tmp
import: 'lightning'
Traceback (most recent call last):
  File "/home/conda/staged-recipes/build_artifacts/lightning_1678550325764/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.11/site-packages/lightning/pytorch/strategies/bagua.py", line 29, in <module>
    from lightning.pytorch.plugins.precision import PrecisionPlugin
  File "/home/conda/staged-recipes/build_artifacts/lightning_1678550325764/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.11/site-packages/lightning/pytorch/plugins/__init__.py", line 7, in <module>
    from lightning.pytorch.plugins.precision.apex_amp import ApexMixedPrecisionPlugin
  File "/home/conda/staged-recipes/build_artifacts/lightning_1678550325764/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.11/site-packages/lightning/pytorch/plugins/precision/__init__.py", line 18, in <module>
    from lightning.pytorch.plugins.precision.fsdp_native_native_amp import FullyShardedNativeNativeMixedPrecisionPlugin
  File "/home/conda/staged-recipes/build_artifacts/lightning_1678550325764/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.11/site-packages/lightning/pytorch/plugins/precision/fsdp_native_native_amp.py", line 24, in <module>
    from torch.distributed.fsdp.fully_sharded_data_parallel import MixedPrecision
  File "/home/conda/staged-recipes/build_artifacts/lightning_1678550325764/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.11/site-packages/torch/distributed/fsdp/__init__.py", line 1, in <module>
    from .flat_param import FlatParameter
  File "/home/conda/staged-recipes/build_artifacts/lightning_1678550325764/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.11/site-packages/torch/distributed/fsdp/flat_param.py", line 26, in <module>
    from ._fsdp_extensions import _ext_post_unflatten_transform, _ext_pre_flatten_transform
  File "/home/conda/staged-recipes/build_artifacts/lightning_1678550325764/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.11/site-packages/torch/distributed/fsdp/_fsdp_extensions.py", line 7, in <module>
    from torch.distributed.fsdp._shard_utils import _create_chunk_sharded_tensor
  File "/home/conda/staged-recipes/build_artifacts/lightning_1678550325764/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.11/site-packages/torch/distributed/fsdp/_shard_utils.py", line 10, in <module>
    from torch.distributed._shard.sharded_tensor import (
  File "/home/conda/staged-recipes/build_artifacts/lightning_1678550325764/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.11/site-packages/torch/distributed/_shard/__init__.py", line 1, in <module>
    from .api import (
  File "/home/conda/staged-recipes/build_artifacts/lightning_1678550325764/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.11/site-packages/torch/distributed/_shard/api.py", line 6, in <module>
    from torch.distributed._shard.sharded_tensor import (
  File "/home/conda/staged-recipes/build_artifacts/lightning_1678550325764/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.11/site-packages/torch/distributed/_shard/sharded_tensor/__init__.py", line 8, in <module>
    import torch.distributed._shard.sharding_spec as shard_spec
  File "/home/conda/staged-recipes/build_artifacts/lightning_1678550325764/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.11/site-packages/torch/distributed/_shard/sharding_spec/__init__.py", line 1, in <module>
    from .api import (
  File "/home/conda/staged-recipes/build_artifacts/lightning_1678550325764/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.11/site-packages/torch/distributed/_shard/sharding_spec/api.py", line 16, in <module>
    import torch.distributed._shard.sharded_tensor.metadata as sharded_tensor_meta
  File "/home/conda/staged-recipes/build_artifacts/lightning_1678550325764/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.11/site-packages/torch/distributed/_shard/sharded_tensor/metadata.py", line 70, in <module>
    @dataclass
     ^^^^^^^^^
  File "/home/conda/staged-recipes/build_artifacts/lightning_1678550325764/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.11/dataclasses.py", line 1221, in dataclass
    return wrap(cls)
           ^^^^^^^^^
  File "/home/conda/staged-recipes/build_artifacts/lightning_1678550325764/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.11/dataclasses.py", line 1211, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/conda/staged-recipes/build_artifacts/lightning_1678550325764/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.11/dataclasses.py", line 959, in _process_class
    cls_fields.append(_get_field(cls, name, type, kw_only))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/conda/staged-recipes/build_artifacts/lightning_1678550325764/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.11/dataclasses.py", line 816, in _get_field
    raise ValueError(f'mutable default {type(f.default)} for field '
ValueError: mutable default <class 'torch.distributed._shard.sharded_tensor.metadata.TensorProperties'> for field tensor_properties is not allowed: use default_factory
Tests failed for lightning-1.9.4-pyhd8ed1ab_0.conda - moving package to /home/conda/staged-recipes/build_artifacts/broken
WARNING:conda_build.build:Tests failed for lightning-1.9.4-pyhd8ed1ab_0.conda - moving package to /home/conda/staged-recipes/build_artifacts/broken
TESTS FAILED: lightning-1.9.4-pyhd8ed1ab_0.conda
##[error]Bash exited with code '1'.

The error looks like Lightning-AI/pytorch-lightning#15614 and is because of building on Python 3.11 (which is not officially supported by Pytorch < 2.0 yet). Can try the suggestion at conda-forge/pytorch-lightning-feedstock#107 (comment) to put an upper bound on python of <3.11 for host, run and test/requires (note though, that things should still work on Python 3.11 (?) but will need a patched version of Pytorch that fixes the dataclass issue).

weiji14 added 2 commits March 13, 2023 10:01
Needed to fix `RuntimeError: Form data requires "python-multipart" to be installed` when running `lightning --help`.
@weiji14 weiji14 marked this pull request as ready for review March 12, 2023 21:31
@weiji14
Copy link
Member Author

weiji14 commented Mar 12, 2023

Windows build failing due to pytorch missing in conda-forge channels (see conda-forge/pytorch-cpu-feedstock#32). Should be ok though since this is a noarch build, similar situation to #15917 (comment).

recipes/lightning/meta.yaml Outdated Show resolved Hide resolved
@weiji14
Copy link
Member Author

weiji14 commented Mar 14, 2023

@conda-forge/help-python, ready for review!

@synapticarbors
Copy link
Member

Is this the successor to https://github.com/conda-forge/pytorch-lightning-feedstock? If so, should there be some coordination with the maintainers of that feedstock?

@weiji14
Copy link
Member Author

weiji14 commented Mar 14, 2023

Is this the successor to https://github.com/conda-forge/pytorch-lightning-feedstock? If so, should there be some coordination with the maintainers of that feedstock?

No, lightning is supposed to be pytorch-lightning + other things. It's confusing because the organization got renamed from Pytorch Lightning to Lightning AI last year, and they changed the repo to https://github.com/Lightning-AI/lightning which is now a monorepo with pytorch-lightning, lightning and other stuff.

@synapticarbors
Copy link
Member

When I look at https://github.com/Lightning-AI/lightning, it says: "NEWS: PyTorch Lightning has been renamed Lightning!" and there are commits like https://github.com/Lightning-AI/lightning/pull/17074/files, which seem to indicate that pytorch lightning is just being renamed. I just want to suggest coordinating with the other feedstock maintainers, especially since one of them is the creator of pytorch lightning.

@weiji14
Copy link
Member Author

weiji14 commented Mar 14, 2023

When I look at https://github.com/Lightning-AI/lightning, it says: "NEWS: PyTorch Lightning has been renamed Lightning!" and there are commits like https://github.com/Lightning-AI/lightning/pull/17074/files, which seem to indicate that pytorch lightning is just being renamed. I just want to suggest coordinating with the other feedstock maintainers, especially since one of them is the creator of pytorch lightning.

Oo ok, that's news to me too. So apparently they might be deprecating pytorch-lightning for lightning in June 2023? Maybe it is worth checking... Cc @Borda?

Edit: Saw the news article at https://lightning.ai/pages/community/lightning-releases/pytorch-lightning-2-0. Changing this to draft for now.

@weiji14 weiji14 marked this pull request as draft March 15, 2023 00:23
@Borda
Copy link
Member

Borda commented Mar 16, 2023

Oo ok, that's news to me too. So apparently they might be deprecating pytorch-lightning for lightning in June 2023? Maybe it is worth checking... Cc @Borda?

this was updated and we do not have any plan for depreciation PL at this moment, so both will live :)

Copy link
Member

@Borda Borda left a comment

Choose a reason for hiding this comment

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

let's start with 2.0

recipes/lightning/meta.yaml Outdated Show resolved Hide resolved
recipes/lightning/meta.yaml Outdated Show resolved Hide resolved
weiji14 and others added 2 commits March 16, 2023 21:10
Set minimum python version to 3.8 and so on.
@weiji14 weiji14 marked this pull request as ready for review March 16, 2023 08:18
weiji14 added 2 commits March 16, 2023 21:42
Similar to 019c0ee, but just setting python<3.11 on test/requires.
Needed to fix `RuntimeError: Form data requires "python-multipart" to be installed` when running `lightning --help`.
@weiji14
Copy link
Member Author

weiji14 commented Mar 16, 2023

Oo ok, that's news to me too. So apparently they might be deprecating pytorch-lightning for lightning in June 2023? Maybe it is worth checking... Cc @Borda?

this was updated and we do not have any plan for depreciation PL at this moment, so both will live :)

Thanks for the clarification. In that case, this should be ready for review again @synapticarbors, cc @conda-forge/help-python. I've updated the version from 1.9.4 to 2.0.0 now.

@weiji14
Copy link
Member Author

weiji14 commented Mar 23, 2023

Gentle ping again @conda-forge/help-python. CI test failure on Windows is due to missing pytorch build as mentioned above at #22249 (comment).

Copy link
Member

@dopplershift dopplershift left a comment

Choose a reason for hiding this comment

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

Recipe looks good. Just need confirmation from @lantiga that they are willing to be listed as a maintainer for this recipe.

@dopplershift dopplershift reopened this Apr 4, 2023
@dopplershift
Copy link
Member

This is timing out on the build, was this a problem previously?

@weiji14
Copy link
Member Author

weiji14 commented Apr 5, 2023

This is timing out on the build, was this a problem previously?

Hmm, the build itself seems to be fine, but it is timing out on the lightning --help test step:

Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
export PREFIX=/home/conda/staged-recipes/build_artifacts/lightning_1680635102681/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh
export SRC_DIR=/home/conda/staged-recipes/build_artifacts/lightning_1680635102681/test_tmp
import: 'lightning'
import: 'lightning'
+ pip check
No broken requirements found.
+ lightning --help
##[error]The operation was canceled.
Finishing: Run docker build

I've re-triggered the CI build, let's see if it was just randomly stuck. Also removed @lantiga for now since he hasn't responded, we can add him back later.

- lightning
commands:
- pip check
- lightning --help
Copy link
Member Author

@weiji14 weiji14 Apr 6, 2023

Choose a reason for hiding this comment

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

This is timing out on the build, was this a problem previously?

Ok, after building and installing lightning==2.0.0 locally and running lightning --help, there is a prompt that requires user input:

A newer version of lightning is available (2.0.1). Would you like to upgrade? [Y/n]:

This is caused by https://github.com/Lightning-AI/lightning/blob/2.0.0/src/lightning/app/cli/lightning_cli.py#L84. Need to find a way to disable this prompt on the CLI, otherwise it'll block the build from completing.

Copy link
Member Author

Choose a reason for hiding this comment

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

Using LIGHTING_TESTING=1 lightning --help in 4661300 worked. @dopplershift, should be ok to merge now!

Silences the `A newer version of lightning is available` user prompt that stops the build from completing on the command-line. Xref https://github.com/Lightning-AI/lightning/blob/2.0.0/src/lightning/app/cli/lightning_cli.py#L76-L84
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants