Skip to content

Commit

Permalink
Fix lint checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Dec 26, 2023
1 parent 5488d72 commit 9c0df0a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions examples/large_models/gpt_fast/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,13 @@ def initialize(self, ctx):
self.local_rank = rank if rank is not None else 0

if torch.cuda.is_available():
if "torchrun" not in ctx.model_yaml_config and properties.get("gpu_id") is not None:
if (
"torchrun" not in ctx.model_yaml_config
and properties.get("gpu_id") is not None
):
gpu_id = properties.get("gpu_id")
else:
gpu_id = self.local_rank
gpu_id = self.local_rank
self.map_location = "cuda"
self.device = torch.device(self.map_location + ":" + str(gpu_id))

Expand Down

0 comments on commit 9c0df0a

Please sign in to comment.