-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f7b1ab
commit 4301251
Showing
9 changed files
with
61 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
tutorials/distributed-ml/torch-scaling-test/slurm_config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# If you use this with in the runall or scaling mode, keep in mind that the strategies | ||
# will change, as well as the number of nodes. | ||
# | ||
# Default arguments can be seen in src/itwinai/slurm/utils.py | ||
# | ||
num_nodes: 1 | ||
num_tasks_per_node: 1 | ||
gpus_per_node: 4 | ||
cpus_per_gpu: 4 | ||
|
||
mode: single # "single", "runall" or "scaling-test" - defaults to "single" | ||
dist_strat: ddp # "ddp", "deepspeed" or "horovod" | ||
itwinai_trainer: false | ||
|
||
account: intertwin | ||
time: 00:10:00 | ||
partition: develbooster | ||
|
||
# Keep in mind that these will be overwritten if "mode" is not "single", and that | ||
# if you override the dist_strat in the CLI, then these will already have evaluated | ||
# and thus might not correspond. Thus, we suggest you only change the dist_strat in | ||
# the config and avoid overriding it in the CLI. | ||
std_out: slurm_jobs/${dist_strat}-${num_nodes}x${gpus_per_node}.out | ||
err_out: slurm_jobs/${dist_strat}-${num_nodes}x${gpus_per_node}.err | ||
job_name: tutorial-${dist_strat}-job | ||
|
||
|
||
python_venv: .venv | ||
|
||
# If you want to manually override the training command, comment in the following: | ||
# training_cmd: | | ||
# $(which itwinai) exec-pipeline \ | ||
# --config ${config_file} \ | ||
# --pipe-key ${pipe_key} \ | ||
# -o strategy=${dist_strat} \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,6 @@ | |
# - Matteo Bunino <[email protected]> - CERN | ||
# - Jarl Sondre Sæther <[email protected]> - CERN | ||
# -------------------------------------------------------------------------------------- | ||
import argparse | ||
|
||
import torch.nn as nn | ||
import torch.nn.functional as F | ||
from torch import device | ||
|
@@ -35,11 +33,11 @@ def imagenet_dataset(data_root: str, subset_size: int | None = None): | |
) | ||
imagenet = datasets.ImageFolder(root=data_root, transform=transform) | ||
|
||
if subset_size is None: | ||
if subset_size is None: | ||
# We do this because we always want to return an instance of a subset, to make | ||
# everything as consistent as possible | ||
subset_size = len(imagenet) | ||
if subset_size > len(imagenet): | ||
if subset_size > len(imagenet): | ||
raise ValueError("Limit higher than the total length of the dataset") | ||
|
||
return Subset(imagenet, range(subset_size)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters