-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(template): complete cifar10 classification (#118)
* feat(template): complete cifar10 classification * feat: add log_every_iters in config.yaml and omegaconf req * chore: use idist.Parallel, spawn_kwargs -> kwargs * feat: add support for argparse and hydra Add configuration library selection in tab Templates * fix: merge config in json file * fix!: keep yaml/hydra combo, add logger pkg in requirements.txt remove json/argparse combo since json.load will result an error for plain `int` and argparse will fail to call string "int" for given inputs. * fix: fix cmd run script in readme, add node_rank * fix: disable hydra logging and outputs path
- Loading branch information
Showing
21 changed files
with
554 additions
and
193 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ dist-ssr | |
*.local | ||
__pycache__ | ||
*.log | ||
.vscode | ||
.vscode | ||
*.tar.gz |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
#::: if (it.dist === 'launch') { :::# | ||
#::: if (it.nproc_per_node) { :::# | ||
#::: if (it.nnodes && it.master_addr && it.master_port) { :::# | ||
|
||
### Multi Node, Multi GPU Training (`torch.distributed.launch`) (recommended) | ||
|
||
- Execute on master node | ||
|
||
```sh | ||
python -m torch.distributed.launch \ | ||
--nproc_per_node #:::= nproc_per_node :::# \ | ||
--nnodes #:::= it.nnodes :::# \ | ||
--node_rank 0 \ | ||
--master_addr #:::= it.master_addr :::# \ | ||
--master_port #:::= it.master_port :::# \ | ||
--use_env main.py backend=nccl \ | ||
hydra.run.dir=. \ | ||
hydra.output_subdir=null \ | ||
hydra/job_logging=disabled \ | ||
hydra/hydra_logging=disabled | ||
``` | ||
|
||
- Execute on worker nodes | ||
|
||
```sh | ||
python -m torch.distributed.launch \ | ||
--nproc_per_node #:::= nproc_per_node :::# \ | ||
--nnodes #:::= it.nnodes :::# \ | ||
--node_rank <node_rank> \ | ||
--master_addr #:::= it.master_addr :::# \ | ||
--master_port #:::= it.master_port :::# \ | ||
--use_env main.py backend=nccl \ | ||
hydra.run.dir=. \ | ||
hydra.output_subdir=null \ | ||
hydra/job_logging=disabled \ | ||
hydra/hydra_logging=disabled | ||
``` | ||
|
||
#::: } else { :::# | ||
|
||
### Multi GPU Training (`torch.distributed.launch`) (recommended) | ||
|
||
```sh | ||
python -m torch.distributed.launch \ | ||
--nproc_per_node #:::= it.nproc_per_node :::# \ | ||
--use_env main.py backend=nccl \ | ||
hydra.run.dir=. \ | ||
hydra.output_subdir=null \ | ||
hydra/job_logging=disabled \ | ||
hydra/hydra_logging=disabled | ||
``` | ||
|
||
#::: } :::# | ||
#::: } :::# | ||
#::: } :::# | ||
|
||
#::: if (it.dist === 'spawn') { :::# | ||
#::: if (it.nproc_per_node) { :::# | ||
#::: if (it.nnodes && it.master_addr && it.master_port) { :::# | ||
|
||
### Multi Node, Multi GPU Training (`torch.multiprocessing.spawn`) | ||
|
||
- Execute on master node | ||
|
||
```sh | ||
python main.py \ | ||
nproc_per_node=#:::= nproc_per_node :::# \ | ||
nnodes=#:::= it.nnodes :::# \ | ||
node_rank=0 \ | ||
master_addr=#:::= it.master_addr :::# \ | ||
master_port=#:::= it.master_port :::# \ | ||
backend=nccl \ | ||
hydra.run.dir=. \ | ||
hydra.output_subdir=null \ | ||
hydra/job_logging=disabled \ | ||
hydra/hydra_logging=disabled | ||
``` | ||
|
||
- Execute on worker nodes | ||
|
||
```sh | ||
python main.py \ | ||
nproc_per_node=#:::= nproc_per_node :::# \ | ||
nnodes=#:::= it.nnodes :::# \ | ||
node_rank=<node_rank> \ | ||
master_addr=#:::= it.master_addr :::# \ | ||
master_port=#:::= it.master_port :::# \ | ||
backend=nccl \ | ||
hydra.run.dir=. \ | ||
hydra.output_subdir=null \ | ||
hydra/job_logging=disabled \ | ||
hydra/hydra_logging=disabled | ||
``` | ||
|
||
#::: } else { :::# | ||
|
||
### Multi GPU Training (`torch.multiprocessing.spawn`) | ||
|
||
```sh | ||
python main.py \ | ||
nproc_per_node=#:::= it.nproc_per_node :::# \ | ||
backend=nccl \ | ||
hydra.run.dir=. \ | ||
hydra.output_subdir=null \ | ||
hydra/job_logging=disabled \ | ||
hydra/hydra_logging=disabled | ||
``` | ||
|
||
#::: } :::# | ||
#::: } :::# | ||
#::: } :::# | ||
|
||
#::: if (!it.nproc_per_node) { :::# | ||
|
||
### 1 GPU Training | ||
|
||
```sh | ||
python main.py \ | ||
hydra.run.dir=. \ | ||
hydra.output_subdir=null \ | ||
hydra/job_logging=disabled \ | ||
hydra/hydra_logging=disabled | ||
``` | ||
|
||
#::: } :::# |
Oops, something went wrong.