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

Added some adjustments for colab #2966

Merged
merged 33 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9605b66
Added some adjustments for colb
AlexejPenner Aug 29, 2024
291c983
Rehauled so notebook execution only requires one Kernel restart
AlexejPenner Aug 29, 2024
5d21764
Reformatted
AlexejPenner Aug 29, 2024
470d9a3
Merge branch 'develop' into feature/small-quickstart-adjustments
AlexejPenner Aug 30, 2024
9f061b2
Reduced requirements.txt, made run.py clearer
AlexejPenner Aug 30, 2024
aca04ca
Caught hardcoded stack name, commented configs
AlexejPenner Aug 30, 2024
02a0548
Formatted
AlexejPenner Aug 30, 2024
f100688
Added Model to quickstart
AlexejPenner Aug 30, 2024
a54e9ea
Using AWS private ecr now
AlexejPenner Aug 30, 2024
0081c8d
Working with aws docker-free
AlexejPenner Aug 30, 2024
362ecdb
Reformatted
AlexejPenner Aug 30, 2024
d6b7595
Training step needs more memory in aws
AlexejPenner Aug 30, 2024
42eba23
Simplified running from CLI
AlexejPenner Sep 2, 2024
84a1167
Formated
AlexejPenner Sep 2, 2024
454afd9
Merge branch 'develop' into feature/small-quickstart-adjustments
AlexejPenner Sep 2, 2024
a5fa755
Applied reviews
AlexejPenner Sep 3, 2024
d97ad98
Merge branch 'feature/small-quickstart-adjustments' of github.com:zen…
AlexejPenner Sep 3, 2024
94df51b
applied PR comments
AlexejPenner Sep 3, 2024
5a55d69
Applied more reviews
AlexejPenner Sep 3, 2024
3a94595
Merge branch 'develop' into feature/small-quickstart-adjustments
AlexejPenner Sep 3, 2024
fd7c0ea
Make aws actually work
AlexejPenner Sep 3, 2024
bcef844
Merge branch 'feature/small-quickstart-adjustments' of github.com:zen…
AlexejPenner Sep 3, 2024
973645d
Linted
AlexejPenner Sep 4, 2024
1e8623f
Auto-update of LLM Finetuning template
actions-user Sep 4, 2024
eb8633c
Auto-update of Starter template
actions-user Sep 4, 2024
5b7f577
Auto-update of E2E template
actions-user Sep 4, 2024
289b8c2
Auto-update of NLP template
actions-user Sep 4, 2024
c394e14
Switch AWS quickstart container image to the AWS production account
stefannica Sep 5, 2024
9577945
Push quickstart AWS image to ECR during the release workflow
stefannica Sep 5, 2024
3a724f5
Fix linter issues
stefannica Sep 6, 2024
f14ab25
Merge branch 'develop' into feature/small-quickstart-adjustments
stefannica Sep 6, 2024
24b3b31
Fix newly introduced wandb linter error
stefannica Sep 6, 2024
032dc69
Merge branch 'feature/small-quickstart-adjustments' of github.com:zen…
stefannica Sep 6, 2024
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
10 changes: 5 additions & 5 deletions examples/quickstart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ the individual steps in the [`steps`](steps) directory. The pipeline that connec
the [`pipeline`](pipelines) directory.

And here is how to run it. When you run the pipeline with the following command you will be using the configuration
[here](configs/training_local.yaml)
[here](configs/training_default.yaml)

```bash
# Run the pipeline locally
python run.py --model_type=t5-small --orchestration_environment local
python run.py --model_type=t5-small
```

<img src=".assets/DAG.png" width="50%" alt="Dashboard view">
Expand Down Expand Up @@ -119,7 +119,7 @@ need an AWS stack registered in ZenML.
zenml integration install aws s3 -y

zenml stack set <INSERT_YOUR_STACK_NAME_HERE>
python run.py --model_type=t5-small --orchestration_environment aws
python run.py --model_type=t5-small
```

You can edit `configs/training_aws.yaml` to adjust the settings for running your pipeline in aws.
Expand All @@ -133,7 +133,7 @@ need an AWS stack registered in ZenML.
zenml integration install gcp

zenml stack set <INSERT_YOUR_STACK_NAME_HERE>
python run.py --model_type=t5-small --orchestration_environment gcp
python run.py --model_type=t5-small
```

You can edit `configs/training_gcp.yaml` to adjust the settings.
Expand All @@ -144,7 +144,7 @@ You can edit `configs/training_gcp.yaml` to adjust the settings.
zenml integration install azure

zenml stack set <INSERT_YOUR_STACK_NAME_HERE>
python run.py --model_type=t5-small --orchestration_environment azure
python run.py --model_type=t5-small
```

You can edit `configs/training_azure.yaml` to adjust the settings.
Expand Down
12 changes: 4 additions & 8 deletions examples/quickstart/configs/training_aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ enable_cache: True

# Environment configuration
settings:
resources:
memory: 64GB
docker:
parent_image: "zenmldocker/zenml-public-pipelines:quickstart-0.65.0-py3.11-aws"
skip_build: False
# Uncomment the following two lines to specify the accelerator for your aws orchestrator
parent_image: "339712793861.dkr.ecr.eu-central-1.amazonaws.com/zenml-public-pipelines:quickstart-0.65.0-py3.11-aws"
skip_build: True # If you switch this to False remove the parent_image
# requirements: requirements.txt
orchestrator.sagemaker:
instance_type: ml.m5.4xlarge

Expand All @@ -19,6 +17,7 @@ model:

# Configure the pipeline
parameters:
data_url: 'https://storage.googleapis.com/zenml-public-bucket/quickstart-files/translations.txt'
# model_type: "t5-small" # Choose between t5-small and t5-large
num_train_epochs: 2
per_device_train_batch_size: 4
Expand All @@ -35,6 +34,3 @@ steps:
test_size: 0.1
eval_size: 0.2
random_state: 42
load_data:
parameters:
data_url: 'https://storage.googleapis.com/zenml-public-bucket/quickstart-files/translations.txt'
8 changes: 5 additions & 3 deletions examples/quickstart/configs/training_azure.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
enable_cache: True

# Environment configuration
settings:
docker:
parent_image: "zenmldocker/zenml-public-pipelines:quickstart-0.65.0-py3.11-azure"
skip_build: True
# requirements: requirements.txt # Uncomment this to add your own dependencies

# Uncomment the following two lines to specify the accelerator for your skypilot vm orchestrator
# orchestrator.vm_azure:
# instance_type: 'Standard_NC6'
AlexejPenner marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -15,6 +19,7 @@ model:

# Configure the pipeline
parameters:
data_url: 'https://storage.googleapis.com/zenml-public-bucket/quickstart-files/translations.txt'
# model_type: "t5-small" # Choose between t5-small and t5-large
num_train_epochs: 2
per_device_train_batch_size: 16
Expand All @@ -31,6 +36,3 @@ steps:
test_size: 0.1
eval_size: 0.2
random_state: 42
load_data:
parameters:
data_url: 'https://storage.googleapis.com/zenml-public-bucket/quickstart-files/translations.txt'
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Environment configuration
settings:
docker:
requirements: requirements.txt

# Model Control Plane configuration
model:
name: YeOldeEnglishTranslator
Expand All @@ -6,6 +11,7 @@ model:

# Configure the pipeline
parameters:
data_url: 'https://storage.googleapis.com/zenml-public-bucket/quickstart-files/translations.txt'
# model_type: "t5-small" # Choose between t5-small and t5-large
num_train_epochs: 1
per_device_train_batch_size: 1
Expand All @@ -21,6 +27,3 @@ steps:
test_size: 0.1
eval_size: 0.2
random_state: 42
load_data:
parameters:
data_url: 'https://storage.googleapis.com/zenml-public-bucket/quickstart-files/translations.txt'
9 changes: 4 additions & 5 deletions examples/quickstart/configs/training_gcp.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
enable_cache: True

# Environment configuration
settings:
resources:
memory: 64GB
docker:
parent_image: "zenmldocker/zenml-public-pipelines:quickstart-0.65.0-py3.11-gcp"
skip_build: True
# requirements: requirements.txt # Uncomment this to add your own dependencies
# Uncomment the following two lines to specify the accelerator for your vertex orchestrator
# orchestrator.vertex:
# node_selector_constraint: ["cloud.google.com/gke-accelerator", "NVIDIA_TESLA_P4"]
Expand All @@ -17,6 +18,7 @@ model:

# Configure the pipeline
parameters:
data_url: 'https://storage.googleapis.com/zenml-public-bucket/quickstart-files/translations.txt'
# model_type: "t5-small" # Choose between t5-small and t5-large
num_train_epochs: 2
per_device_train_batch_size: 16
Expand All @@ -32,6 +34,3 @@ steps:
test_size: 0.1
eval_size: 0.2
random_state: 42
load_data:
parameters:
data_url: 'https://storage.googleapis.com/zenml-public-bucket/quickstart-files/translations.txt'
3 changes: 2 additions & 1 deletion examples/quickstart/pipelines/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@

@pipeline
def english_translation_pipeline(
data_url: str,
model_type: T5_Model,
per_device_train_batch_size: int,
gradient_accumulation_steps: int,
dataloader_num_workers: int,
num_train_epochs: int = 5,
):
"""Define a pipeline that connects the steps."""
full_dataset = load_data()
full_dataset = load_data(data_url)
tokenized_dataset, tokenizer = tokenize_data(
dataset=full_dataset, model_type=model_type
)
Expand Down
Loading
Loading