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

update ddp example spec #554

Merged
merged 2 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
30 changes: 25 additions & 5 deletions specs/examples/training/ddp.cue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#EXP_NAME: "encoding_coarsener"
#EXP_VERSION: "remote_ddp_x52"
#EXP_VERSION: "single_spec_ddp_x0"

#TRAINING_ROOT: "gs://tmp_2w/examples/training_artifacts"

Expand All @@ -8,15 +8,35 @@
#ENCODER_CKPT: null
#DECODER_CKPT: null


#ENC_CV: "gs://fafb_v15_aligned/v0/img/img"

"@type": "lightning_train"

///////////////////////////////////////////////////////////////////
////////////////////////// DDP Config /////////////////////////////
///////////////////////////////////////////////////////////////////
local_run: false
cluster_name: "zutils-x3"
cluster_region: "us-east1"
cluster_project: "zetta-research"
image: "us.gcr.io/zetta-research/zetta_utils:single_spec_ddp_x0"
resource_requests: {
memory: "8192Mi"
"nvidia.com/gpu": "1"
}
resource_limits: {
memory: "8192Mi"
"nvidia.com/gpu": "1"
}
env_vars: {
"LOGLEVEL": "INFO"
"NCCL_SOCKET_IFNAME": "eth0"
}

///////////////////////////////////////////////////////////////////
//////////////////////// Training Spec ////////////////////////////
///////////////////////////////////////////////////////////////////

"@type": "lightning_train"
regime: {
"@type": "EncodingCoarsenerRegime"
lr: 4e-4
Expand All @@ -42,7 +62,7 @@ trainer: {
"@type": "ZettaDefaultTrainer"
accelerator: "cuda"
devices: 1
num_nodes: 32
num_nodes: 1
max_epochs: 100
default_root_dir: #TRAINING_ROOT
experiment_name: #EXP_NAME
Expand Down Expand Up @@ -121,7 +141,7 @@ trainer: {
{
"@type": "to_float32"
"@mode": "partial"
}
},
]
}
}
Expand Down
17 changes: 0 additions & 17 deletions specs/examples/training/ddp_config.cue

This file was deleted.

5 changes: 2 additions & 3 deletions zetta_utils/training/lightning/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,8 @@ def lightning_train(
return

assert image is not None, "Must provide a container image for remote training."
assert (
resource_requests or resource_limits
), "Must provide at least one of resource requests or limits for remote training."
assert resource_limits is not None, "Must provide resource limits for remote training."

execution_id = mazepa.id_generation.get_unique_id(
prefix="exec", slug_len=4, add_uuid=False, max_len=50
)
Expand Down
Loading