Skip to content

Commit

Permalink
Merge pull request #436 from datamol-io/strategy
Browse files Browse the repository at this point in the history
Strategy defaults to 'auto'
  • Loading branch information
DomInvivo committed Aug 16, 2023
2 parents d97f80c + 81d1d9d commit 2415fd8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion graphium/config/_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def load_trainer(
cfg_trainer = deepcopy(config["trainer"])

# Define the IPU plugin if required
strategy = "auto"
strategy = config["trainer"]["trainer"].get("strategy", "auto")
if accelerator_type == "ipu":
ipu_opts, ipu_inference_opts = _get_ipu_opts(config)

Expand All @@ -385,6 +385,9 @@ def load_trainer(
precision=config["trainer"]["trainer"].get("precision"),
)

if strategy != "auto":
raise ValueError("IPUs selected, but strategy is not set to 'auto'")

from lightning_graphcore import IPUStrategy

strategy = IPUStrategy(training_opts=training_opts, inference_opts=inference_opts)
Expand Down

0 comments on commit 2415fd8

Please sign in to comment.