Skip to content

Commit

Permalink
Adding gres handling for teach
Browse files Browse the repository at this point in the history
Adding srun's gres parameter handling logic for teach in order to pass the requested gres and set the default num_gpus if not requested when c=teach and p=gpu
  • Loading branch information
yassinkhalifa committed Aug 23, 2024
1 parent b4d5bd4 commit cdfa3b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/crc_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def parse_args(self, args=None, namespace=None) -> Namespace:

# Set defaults that need to be determined dynamically
if not args.num_gpus:
args.num_gpus = 1 if args.gpu else 0
args.num_gpus = 1 if (args.gpu or (args.teach and (args.partition == 'gpu'))) else 0

# Check wall time is between limits, enable both %H:%M format and integer hours
check_time = args.time.hour + args.time.minute / 60 + args.time.second / 3600
Expand Down Expand Up @@ -171,7 +171,7 @@ def create_srun_command(self, args: Namespace) -> str:
srun_args += ' ' + srun_arg_name.format(arg_value)

# The --gres argument in srun needs some special handling so is missing from the above dict
if (args.gpu or args.invest) and args.num_gpus:
if (args.gpu or args.invest or (args.teach and (args.partition == 'gpu'))) and args.num_gpus:
srun_args += ' ' + f'--gres=gpu:{args.num_gpus}'

try:
Expand Down

0 comments on commit cdfa3b0

Please sign in to comment.