Skip to content

Commit 81d1d9d

Browse files
committed
Allow strategy in configs
1 parent 4d472d7 commit 81d1d9d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

graphium/config/_loader.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ def load_trainer(
372372
cfg_trainer = deepcopy(config["trainer"])
373373

374374
# Define the IPU plugin if required
375-
strategy = "auto"
375+
strategy = config["trainer"]["trainer"].get("strategy", "auto")
376376
if accelerator_type == "ipu":
377377
ipu_opts, ipu_inference_opts = _get_ipu_opts(config)
378378

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

388+
if strategy != "auto":
389+
raise ValueError("IPUs selected, but strategy is not set to 'auto'")
390+
388391
from lightning_graphcore import IPUStrategy
389392

390393
strategy = IPUStrategy(training_opts=training_opts, inference_opts=inference_opts)

0 commit comments

Comments
 (0)