Skip to content

Commit

Permalink
Adding per rank mlflow tracking location to fix race condition and up…
Browse files Browse the repository at this point in the history
…dating fcn_afno config for easier benchmarking (#121)

Signed-off-by: Akshay Subramaniam <[email protected]>
  • Loading branch information
akshaysubr authored Oct 6, 2023
1 parent 360c726 commit ef94792
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions examples/weather/fcn_afno/conf/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ hydra:
dir: ./outputs/

wb_artifacts: False
use_mlflow: True

start_epoch: 0
max_epoch: 80

num_samples_per_year_train: 1456
4 changes: 2 additions & 2 deletions examples/weather/fcn_afno/train_era5.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def main(cfg: DictConfig) -> None:
user_name="Modulus User",
mode="offline",
)
LaunchLogger.initialize(use_mlflow=True) # Modulus launch logger
LaunchLogger.initialize(use_mlflow=cfg.use_mlflow) # Modulus launch logger
logger = PythonLogger("main") # General python logger

datapipe = ERA5HDF5Datapipe(
Expand Down Expand Up @@ -199,7 +199,7 @@ def train_step_forward(my_model, invar, outvar):
return loss

# Main training loop
max_epoch = 80
max_epoch = cfg.max_epoch
for epoch in range(max(1, loaded_epoch + 1), max_epoch + 1):
# Wrap epoch in launch logger for console / WandB logs
with LaunchLogger(
Expand Down
2 changes: 1 addition & 1 deletion modulus/launch/logging/mlflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def initialize_mlflow(
group_name = f"{run_name}_{time_string}"
# Set default value here for Hydra
if tracking_location is None:
tracking_location = str(Path("./mlruns").absolute())
tracking_location = str(Path(f"./mlruns_{dist.rank}").absolute())

# Set up URI (remote or local)
if mode == "online":
Expand Down

0 comments on commit ef94792

Please sign in to comment.