Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b089f8c
[App] Introduce basic auth to Lightning CLI (#16105)
dmitsf Dec 22, 2022
c4547fe
docs: fix order of on_fit_start() hook (#16180)
davidgilbertson Dec 22, 2022
bce415e
docs: updated broken links (#16191)
ShashwatAgrawal20 Dec 24, 2022
5e876f1
Always use the local rank zero imports (#16178)
carmocca Dec 24, 2022
16ebbdf
update BYOC documentation with AWS details (#16044)
nicolai86 Dec 24, 2022
dc08e97
Using internal ip + port in a load balancer instead of URL exposed (#…
dmitsf Dec 24, 2022
6f3e8f9
Remove CUDA_LAUNCH_BLOCKING from Lite tests (#16177)
carmocca Dec 24, 2022
3f2e559
simplify torch.Tensor (#16190)
Borda Dec 24, 2022
58e6663
Fix inclusion of `model_parallel` document (#16197)
awaelchli Dec 26, 2022
bf273e1
Update numpy requirement from <1.23.1,>=1.17.2 to >=1.17.2,<1.24.1 in…
dependabot[bot] Dec 26, 2022
968635c
Update s3fs requirement from <2022.8.3,>=2022.5.0 to >=2022.5.0,<2022…
dependabot[bot] Dec 26, 2022
1e627de
ci: upload only with release (#16194)
Borda Dec 28, 2022
9fbf82f
Update endpoint access examples: added info about accessing auth-prot…
dmitsf Jan 2, 2023
d3de04b
Skip a failing Bagua test for manual optimization (#16225)
awaelchli Jan 3, 2023
a36801c
Fix type error when dividing chunk size in colossalai strategy (#16212)
1SAA Jan 3, 2023
d8e3435
Fix DDP on XLA (#16020)
Liyang90 Jan 3, 2023
0fb5e39
Added support and test for custom artifact names in WandbLogger (#16173)
manangoel99 Jan 3, 2023
d9b5ce9
Update ipython[all] requirement from <8.6.1 to <8.7.1 in /requirement…
dependabot[bot] Jan 4, 2023
83a2c9f
Improvements to checkpoint migration (#16233)
awaelchli Jan 4, 2023
e403c35
Support arbitrary `Optimizable`s as optimizers (#16189)
carmocca Jan 4, 2023
ae5d360
Differences with master
carmocca Jan 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ We recommend you follow this convention `<type>/<issue-id>_<short-name>` where t

We recommend creating a PR in a separate branch other than `master`, especially if you plan to submit several changes and do not want to wait until the first one is resolved (we can work on them in parallel).

First, make sure you have set [upstream](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/configuring-a-remote-for-a-fork) by running:
First, make sure you have set [upstream](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/configuring-a-remote-repository-for-a-fork) by running:

```bash
git remote add upstream https://github.com/Lightning-AI/lightning.git
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ defaults:

jobs:


build-packages:
uses: ./.github/workflows/_build-packages.yml
with:
Expand All @@ -23,7 +22,7 @@ jobs:
upload-packages:
runs-on: ubuntu-20.04
needs: build-packages
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
Expand Down
34 changes: 15 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,36 +367,32 @@ ______________________________________________________________________

## Examples

###### Hello world
###### Self-supervised Learning

- [MNIST hello world](https://pytorch-lightning.readthedocs.io/en/latest/notebooks/lightning_examples/mnist-hello-world.html)
- [CPC transforms](https://lightning-bolts.readthedocs.io/en/stable/transforms/self_supervised.html#cpc-transforms)
- [Moco v2 tranforms](https://lightning-bolts.readthedocs.io/en/stable/transforms/self_supervised.html#moco-v2-transforms)
- [SimCLR transforms](https://lightning-bolts.readthedocs.io/en/stable/transforms/self_supervised.html#simclr-transforms)

###### Contrastive Learning
###### Convolutional Architectures

- [BYOL](https://lightning-bolts.readthedocs.io/en/stable/deprecated/models/self_supervised.html#byol)
- [CPC v2](https://lightning-bolts.readthedocs.io/en/stable/deprecated/models/self_supervised.html#cpc-v2)
- [Moco v2](https://lightning-bolts.readthedocs.io/en/stable/deprecated/models/self_supervised.html#moco-v2-api)
- [SIMCLR](https://lightning-bolts.readthedocs.io/en/stable/deprecated/models/self_supervised.html#simclr)

###### NLP

- [GPT-2](https://lightning-bolts.readthedocs.io/en/stable/deprecated/models/convolutional.html#gpt-2)
- [BERT](https://pytorch-lightning.readthedocs.io/en/latest/notebooks/lightning_examples/text-transformers.html)
- [GPT-2](https://lightning-bolts.readthedocs.io/en/stable/models/convolutional.html#gpt-2)
- [UNet](https://lightning-bolts.readthedocs.io/en/stable/models/convolutional.html#unet)

###### Reinforcement Learning

- [DQN](https://lightning-bolts.readthedocs.io/en/stable/deprecated/models/reinforce_learn.html#dqn-models)
- [Dueling-DQN](https://lightning-bolts.readthedocs.io/en/stable/deprecated/models/reinforce_learn.html#dueling-dqn)
- [Reinforce](https://lightning-bolts.readthedocs.io/en/stable/deprecated/models/reinforce_learn.html#reinforce)
- [DQN Loss](https://lightning-bolts.readthedocs.io/en/stable/losses.html#dqn-loss)
- [Double DQN Loss](https://lightning-bolts.readthedocs.io/en/stable/losses.html#double-dqn-loss)
- [Per DQN Loss](https://lightning-bolts.readthedocs.io/en/stable/losses.html#per-dqn-loss)

###### Vision
###### GANs

- [GAN](https://pytorch-lightning.readthedocs.io/en/latest/notebooks/lightning_examples/basic-gan.html)
- [Basic GAN](https://lightning-bolts.readthedocs.io/en/stable/models/gans.html#basic-gan)
- [DCGAN](https://lightning-bolts.readthedocs.io/en/stable/models/gans.html#dcgan)

###### Classic ML

- [Logistic Regression](https://lightning-bolts.readthedocs.io/en/stable/deprecated/models/classic_ml.html#logistic-regression)
- [Linear Regression](https://lightning-bolts.readthedocs.io/en/stable/deprecated/models/classic_ml.html#linear-regression)
- [Logistic Regression](https://lightning-bolts.readthedocs.io/en/stable/models/classic_ml.html#logistic-regression)
- [Linear Regression](https://lightning-bolts.readthedocs.io/en/stable/models/classic_ml.html#linear-regression)

______________________________________________________________________

Expand Down
2 changes: 0 additions & 2 deletions dockers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ docker run --rm -it --gpus all pytorchlightning/pytorch_lightning:base-cuda-py3.

## Run Jupyter server

Inspiration comes from https://u.group/thinking/how-to-put-jupyter-notebooks-in-a-dockerfile

1. Build the docker image:
```bash
docker image build -t pytorch-lightning:v1.6.5 -f dockers/nvidia/Dockerfile --build-arg LIGHTNING_VERSION=1.6.5 .
Expand Down
134 changes: 134 additions & 0 deletions docs/source-app/workflows/byoc/aws_cli.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
:orphan:

.. _aws_cli:


############################
Create AWS role with AWS CLI
############################

1. Install AWS CLI (see instructions `here <https://aws.amazon.com/cli/>`_).

2. Protect your role by creating a hard to guess password that will be used to authenticate Lightning (You will need to pass it to Lightning for authentication). In our example we will use `dummy`.

3. Create a role called `lightning-cloud` using the following command (replace <YOUR-HARD-TO-GUESS-PASSWORD> with your own):

.. code:: bash

aws iam create-role \
--role-name lightning-cloud \
--assume-role-policy-document '{"Statement":[{"Action":"sts:AssumeRole","Effect": "Allow", "Principal": {"AWS": "arn:aws:iam::748115360335:root"}, "Condition": {"StringEquals": {"sts:ExternalId": "<YOUR-HARD-TO-GUESS-PASSWORD>"}}}]}' \
--description " " \
--max-session-duration 43200

4. Create a file `iam-policy.json` with the following permissions required for Lightning to manage cloud infrastructure for you:

.. code:: json

{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"autoscaling:*",
"cloudwatch:*",
"ec2:*",
"ecr:*",
"eks:*",
"elasticloadbalancing:*",
"events:*",
"guardduty:*",
"iam:*",
"logs:*",
"route53resolver:*",
"s3:*",
"sns:*",
"sqs:*",
"tag:GetResources",
"resource-groups:SearchResources"
],
"Effect": "Allow",
"Resource": "*"
},
{
"Effect": "Allow",
"Action": "iam:CreateServiceLinkedRole",
"Resource": "*",
"Condition": {
"StringLike": {
"iam:AWSServiceName": [
"guardduty.amazonaws.com",
"malware-protection.guardduty.amazonaws.com"
]
}
}
},
{
"Effect": "Allow",
"Action": "iam:CreateServiceLinkedRole",
"Resource": "*",
"Condition": {
"StringEquals": {
"iam:AWSServiceName": [
"autoscaling.amazonaws.com",
"ec2scheduled.amazonaws.com",
"elasticloadbalancing.amazonaws.com",
"spot.amazonaws.com",
"spotfleet.amazonaws.com",
"transitgateway.amazonaws.com"
]
}
}
}
]
}

5. Create a IAM policy and associate it with the role we just created, and pass in the path to your new file:

.. code:: bash

aws iam create-policy \
--policy-name lightning-cloud \
--description "policy granting lightning controlplane permissions" \
--policy-document file:///my_dir/iam-policy.json

6. Fetch the role ARN so you can attach the policy:

.. code:: bash

aws iam get-role --role-name lightning-cloud --output json --query Role.Arn

7. Attach the policy to the IAM role you just created:

.. code:: bash

aws iam attach-role-policy \
--role-name lightning-cloud \
--policy-arn arn:aws:iam::1234567890:policy/lightning-cloud

------

**********************
Next: Create a cluster
**********************

You are now ready to create a Lightning cluster!

.. raw:: html

<div class="display-card-container">
<div class="row">

.. Add callout items below this line

.. displayitem::
:header: Create cluster
:description: Create an AWS cluster for running ligthning apps, skip to step 2
:button_link: create_cluster.html
:col_css: col-md-12
:height: 170

.. raw:: html

</div>
</div>
102 changes: 102 additions & 0 deletions docs/source-app/workflows/byoc/aws_console.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
:orphan:

.. _aws_console:


###########################################
Create AWS role with AWS management console
###########################################

See the following video for instructions:

.. raw:: html

<video width="100%" max-width="800px" controls autoplay muted playsinline
src="https://lightningaidev.wpengine.com/wp-content/uploads/2022/12/byoc.mp4"></video>

|


1.1- Create a role
------------------

The created role will give Lightning AI access (by specifying Ligthning account id), and will

1. Sign in to your AWS account. (If you don’t have an AWS account, create one).

2. On AWS console search for IAM > Roles > Create role.

In your new role set the following:

* Trusted entity type -> AWS account.

* An AWS account -> Another AWS account -> Account id: 748115360335. (This is Lightning's account id).

3. Protect your role by creating a hard to guess password that will be used to authenticate Lightning (You will need to pass it to Lightning for authnetication).

* Set Require external ID: <put-your-hard-to-guess-token>

4. Click "Next"


1.2- Create a policy
--------------------

1. Click "Create policy" -> A new tab opens to the Create policy page.

2. Click the JSON tab and copy-paste the `contents of this JSON file <https://gist.github.com/nicolai86/79b9caa5a3557d9d4f8a6e2227e34f2d>` into the JSON workspace.

.. note: Ignore the warnings generated by AWS.

3. Click "Next:Tags" (you can skip this step)

4. Complete policy creation by adding a meaningful name and description to the policy.

For example:

Name -> "lightning-cloud"

Description -> "permission to manage EC2 instances"

5. Add policy to the role: Return to the browser tab that you were using to create a role.
Refresh the policy list and select the custom policy you just created (in this case “lai-byoc-policy”). The policy should appear at the top of the Policy List.

6. Click "Next".

7. Provide a meaningful name and description for the role, and click “Create Role”.

For example:

Name -> "lightning-cloud"

Description -> "Role for Lightning cloud permissions"

Congrats! You now successfully added the set up permissions needed for lightning to create a cluster.


------

**********************
Next: Create a cluster
**********************

You are now ready to create a Lightning cluster!

.. raw:: html

<div class="display-card-container">
<div class="row">

.. Add callout items below this line

.. displayitem::
:header: Create cluster
:description: Create an AWS cluster for running ligthning apps, skip to step 2
:button_link: create_cluster.html
:col_css: col-md-12
:height: 170

.. raw:: html

</div>
</div>
Loading