Skip to content

Commit

Permalink
Update Lightning dependencies and examples headers (awslabs#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnanuti authored and IsaevIlya committed Mar 13, 2024
1 parent 37d6c41 commit cbf5c4c
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:

- name: Install Lightning dependency
run: |
python -m pip install -e "s3torchconnector[lightning]"
python -m pip install -e "s3torchconnector[lightning-tests]"
- name: s3torchconnector lightning unit tests
run: pytest s3torchconnector/tst/unit/lightning --hypothesis-profile ci --hypothesis-show-statistics -c ./

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
- name: Install Lightning dependency
run: |
python -m pip install -e "s3torchconnector[lightning]"
python -m pip install -e "s3torchconnector[lightning-tests]"
- name: s3torchconnector lightning e2e tests
run: |
CI_REGION=${{ matrix.test-run.region }} \
Expand Down
6 changes: 5 additions & 1 deletion s3torchconnector/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ e2e = [
]

lightning = [
"lightning >= 2.0",
"lightning >= 2.0"
]

lightning-tests = [
"s3torchconnector[lightning]",
"s3fs"
]

Expand Down
8 changes: 6 additions & 2 deletions s3torchconnector/tst/e2e/models/lightning_transformer.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
"""
Based on: https://lightning.ai/docs/pytorch/stable/common/lightning_module.html
Source: https://github.com/Lightning-AI/pytorch-lightning/blob/master/docs/source-pytorch/common/lightning_module.rst
License: https://github.com/Lightning-AI/pytorch-lightning/blob/master/LICENSE
"""

import lightning as L
import torch

from lightning.pytorch.demos import Transformer

# Based on https://lightning.ai/docs/pytorch/stable/common/lightning_module.html


class LightningTransformer(L.LightningModule):
def __init__(self, vocab_size):
Expand Down
8 changes: 6 additions & 2 deletions s3torchconnector/tst/e2e/models/net.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
"""
Based on: https://pytorch.org/tutorials/beginner/blitz/neural_networks_tutorial.html
Source: https://github.com/pytorch/tutorials/blob/main/beginner_source/blitz/neural_networks_tutorial.py
License: https://github.com/pytorch/tutorials/blob/main/LICENSE
"""

import torch
import torch.nn.functional as F
from torch import nn

# Based on https://pytorch.org/tutorials/beginner/blitz/neural_networks_tutorial.html


class Net(nn.Module):
def __init__(self):
Expand Down
2 changes: 1 addition & 1 deletion s3torchconnectorclient/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ test-command = [
"CI_STORAGE_CLASS='' CI_REGION=${S3_REGION} CI_BUCKET=${S3_BUCKET} CI_PREFIX=${S3_PREFIX} CI_CUSTOM_ENDPOINT_URL=${S3_CUSTOM_ENDPOINT_URL} pytest {package}/../s3torchconnector/tst/e2e --ignore {package}/../s3torchconnector/tst/e2e/test_e2e_s3_lightning_checkpoint.py",
"CI_STORAGE_CLASS=EXPRESS_ONEZONE CI_REGION=${S3_EXPRESS_REGION} CI_BUCKET=${S3_EXPRESS_BUCKET} CI_PREFIX=${S3_PREFIX} CI_CUSTOM_ENDPOINT_URL='' pytest {package}/python/tst/integration",
"CI_STORAGE_CLASS=EXPRESS_ONEZONE CI_REGION=${S3_EXPRESS_REGION} CI_BUCKET=${S3_EXPRESS_BUCKET} CI_PREFIX=${S3_PREFIX} CI_CUSTOM_ENDPOINT_URL='' pytest {package}/../s3torchconnector/tst/e2e --ignore {package}/../s3torchconnector/tst/e2e/test_e2e_s3_lightning_checkpoint.py",
"python -m pip install -e '{package}/../s3torchconnector[lightning]'",
"python -m pip install -e '{package}/../s3torchconnector[lightning-tests]'",
"pytest {package}/../s3torchconnector/tst/unit/lightning",
"CI_STORAGE_CLASS='' CI_REGION=${S3_REGION} CI_BUCKET=${S3_BUCKET} CI_PREFIX=${S3_PREFIX} CI_CUSTOM_ENDPOINT_URL=${S3_CUSTOM_ENDPOINT_URL} pytest {package}/../s3torchconnector/tst/e2e/test_e2e_s3_lightning_checkpoint.py",
"AWS_DEFAULT_REGION=${S3_EXPRESS_REGION} CI_STORAGE_CLASS=EXPRESS_ONEZONE CI_REGION=${S3_EXPRESS_REGION} CI_BUCKET=${S3_EXPRESS_BUCKET} CI_PREFIX=${S3_PREFIX} CI_CUSTOM_ENDPOINT_URL='' pytest {package}/../s3torchconnector/tst/e2e/test_e2e_s3_lightning_checkpoint.py",
Expand Down

0 comments on commit cbf5c4c

Please sign in to comment.