Skip to content

Commit

Permalink
feat: add the option to use a seingel gpu
Browse files Browse the repository at this point in the history
  • Loading branch information
antidodo committed Nov 14, 2023
1 parent da7ba37 commit c62dde9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions airflow/dags/DAG_PHT_run_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@ def execute_container(train_state):
raise ValueError(
f"Invalid gpu configuration: {gpu_config}. Must be a list of integers or 'all'"
)
elif isinstance(gpu_config, int):
device_request = docker.types.DeviceRequest(
device_ids=[str(gpu_config)], capabilities=[["gpu"]]
)
else:
raise ValueError(
f"Invalid gpu configuration: {gpu_config}. Must be a list of integers or 'all'"
Expand Down

0 comments on commit c62dde9

Please sign in to comment.