From 0661abc545c4641f4251bd3297a2665381a108a6 Mon Sep 17 00:00:00 2001 From: Jaimeen Ahn <32367255+jaimeenahn@users.noreply.github.com> Date: Tue, 27 Apr 2021 02:30:48 +0900 Subject: [PATCH] Variable Correction for Consistency in Distillation Example (#11444) As the error comes from the inconsistency of variable meaning number of gpus in parser and its actual usage in the train.py script, 'gpus' and 'n_gpu' respectively, the correction makes the example work --- examples/research_projects/distillation/README.md | 2 +- examples/research_projects/distillation/train.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/research_projects/distillation/README.md b/examples/research_projects/distillation/README.md index 3dc2c53a1e..36b45f7988 100644 --- a/examples/research_projects/distillation/README.md +++ b/examples/research_projects/distillation/README.md @@ -163,7 +163,7 @@ python -m torch.distributed.launch \ --master_port $MASTER_PORT \ train.py \ --force \ - --gpus $WORLD_SIZE \ + --n_gpu $WORLD_SIZE \ --student_type distilbert \ --student_config training_configs/distilbert-base-uncased.json \ --teacher_type bert \ diff --git a/examples/research_projects/distillation/train.py b/examples/research_projects/distillation/train.py index ce5df33198..0d21ae04f8 100644 --- a/examples/research_projects/distillation/train.py +++ b/examples/research_projects/distillation/train.py @@ -210,7 +210,7 @@ def main(): help="For fp16: Apex AMP optimization level selected in ['O0', 'O1', 'O2', and 'O3']." "See details at https://nvidia.github.io/apex/amp.html", ) - parser.add_argument("--gpus", type=int, default=1, help="Number of GPUs in the node.") + parser.add_argument("--n_gpu", type=int, default=1, help="Number of GPUs in the node.") parser.add_argument("--local_rank", type=int, default=-1, help="Distributed training - Local rank") parser.add_argument("--seed", type=int, default=56, help="Random seed")