File tree Expand file tree Collapse file tree
src/ocean_emulators/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -170,9 +170,10 @@ You can run `uv run -m ocean_emulators.train --help` to see all the options avai
170170To learn more about other datasets used during training, please see the _ Data Engineering_ section below.
171171
172172To run a remote training job with Skypilot, use the following command:
173+
173174``` shell
174175# export WANDB_API_KEY=<my-key> # Get your key at https://wandb.ai/authorize
175- # sky launch -c fomo-cluster train.sky.yaml --env WANDB_API_KEY --env-file <my-vars>.env
176+ uv run sky launch train.sky.yaml --env WANDB_API_KEY --env-file < my-vars> .env
176177```
177178
178179Please read the docstring in the ` train.sky.yaml ` for more information.
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ dependencies = [
3838 " s3fs>=2025.5.1" ,
3939 " scipy>=1.15.2" ,
4040 " skypilot[aws,lambda]>=0.10" ,
41+ " sqlalchemy>=2" , # skypilot requires sqlalchemy 2.0 but doesn't include that requirement
4142 " torch~=2.2.1" ,
4243 " torchinfo>=1.8" ,
4344 " wandb>=0.19.8" ,
Original file line number Diff line number Diff line change @@ -25,19 +25,22 @@ def set_seed(seed):
2525 # torch.use_deterministic_algorithms(True)
2626
2727
28- def suppress_prints (is_master ):
29- """This function disables printing when not in master process."""
30- builtin_print = builtins .print
28+ builtin_print = builtins .print
29+
30+
31+ def print (* args , ** kwargs ):
32+ force = kwargs .pop ("force" , False )
33+ force = force or (get_world_size () > 8 )
34+ if force :
35+ now = datetime .datetime .now ().time ()
36+ builtin_print (f"[{ now } ] " , end = "" ) # print with time stamp
37+ builtin_print (* args , ** kwargs )
3138
32- def print (* args , ** kwargs ):
33- force = kwargs .pop ("force" , False )
34- force = force or (get_world_size () > 8 )
35- if is_master or force :
36- now = datetime .datetime .now ().time ()
37- builtin_print (f"[{ now } ] " , end = "" ) # print with time stamp
38- builtin_print (* args , ** kwargs )
3939
40- builtins .print = print
40+ def suppress_prints (is_master ):
41+ """This function disables printing when not in master process."""
42+ if not is_master :
43+ builtins .print = print
4144
4245
4346def suppress_logging (is_master ):
Original file line number Diff line number Diff line change 66# ```
77# sky check -v
88# ```
9+ # You will generally need to create a dedicated IAM user for skypilot, and put
10+ # your lambda credentials in ~/.lambda_cloud/ -- the `sky check -v` command has more details.
911#
1012# To create or re-use a cluster:
1113# ```
1214# export WANDB_API_KEY=<my-key> # Get your key at https://wandb.ai/authorize
13- # sky launch -c fomo-cluster train.sky.yaml --env-file <my-env>.env --env WANDB_API_KEY
15+ # uv run sky launch train.sky.yaml --env-file <my-env>.env --env WANDB_API_KEY
1416# ```
1517# As the job progresses, skypilot will provide commands to locally monitor each stage.
1618#
4446 # We assume that data in this directory is named in the same pattern as
4547 # the $DATA_CONFIG yaml.
4648 DATA_ROOT_PATH : null # data/om4_onedeg_compact # NOTE: path cannot end in a slash `/`.
49+ ARGS : " "
4750
4851file_mounts :
4952 # TODO(alxmrs): Consider adding a data/ COPY file_mount here once `mount_options` feature exists.
@@ -56,6 +59,8 @@ file_mounts:
5659workdir : .
5760
5861setup : |
62+ set -ex
63+
5964 mkdir ~/data/
6065 rclone config create s3-source s3 provider=AWS env_auth=true
6166
@@ -64,6 +69,8 @@ setup: |
6469 rclone copy --progress s3-source:${DATA_BUCKET}/${DATA_ROOT_PATH}/OM4.zarr ~/data/OM4.zarr --transfers=32 --ignore-existing
6570
6671run : |
72+ set -ex
73+
6774 MASTER_ADDR=$(echo "$SKYPILOT_NODE_IPS" | head -n1)
6875 echo "Starting distributed training, head node: $MASTER_ADDR"
6976
8693 --experiment.data_root=${DATA_ROOT} \
8794 --experiment.base_output_dir=/outputs/ \
8895 --experiment.wandb.mode=online \
89- --samudra.checkpointing=all
96+ ${ARGS}
You can’t perform that action at this time.
0 commit comments