Skip to content

Commit

Permalink
passes local rank via environment variable (#1784)
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarques committed Oct 20, 2023
1 parent 05a300f commit 915306a
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/sparseml/pytorch/torchvision/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def collate_fn(batch):
)

_LOGGER.info("Creating model")
local_rank = args.local_rank if args.distributed else None
local_rank = int(os.environ["LOCAL_RANK"]) if args.distributed else None
model, arch_key, maybe_dp_device = _create_model(
arch_key=args.arch_key,
local_rank=local_rank,
Expand Down Expand Up @@ -1256,14 +1256,6 @@ def new_func(*args, **kwargs):
"Note: Will use ImageNet values if not specified."
),
)
@click.option(
"--local_rank",
"--local-rank",
type=int,
default=None,
help="Local rank for distributed training",
hidden=True, # should not be modified by user
)
@click.pass_context
def cli(ctx, **kwargs):
"""
Expand Down

0 comments on commit 915306a

Please sign in to comment.