Skip to content

Commit

Permalink
Typo fix: correct gpu flag "preferred" (#38)
Browse files Browse the repository at this point in the history
* terminating task solved?

* add a little bit of typing

* gpu config poccessing

* try-except

* added container drop

* add container removal in try-except

* specify docker exception in try-except

* autoremove comment

* typo

* merge conflicts
  • Loading branch information
TheoLisin authored Sep 28, 2023
1 parent afa7b59 commit 7f6f9f1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions agent/worker/task_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@


class GPUFlag(Enum):
preffered: str = "preffered"
preferred: str = "preferred"
required: str = "required"
skipped: str = "skipped"

Expand All @@ -68,8 +68,8 @@ def from_config(cls, config: dict) -> GPUFlag:

@classmethod
def from_str(cls, config_val: Optional[str]) -> GPUFlag:
if config_val == "preffered":
return GPUFlag.preffered
if config_val == "preferred":
return GPUFlag.preferred
elif config_val == "required":
return GPUFlag.required
elif config_val is None:
Expand Down Expand Up @@ -227,7 +227,7 @@ def init_docker_image(self):
raise RuntimeError(
f"Runtime {nvidia} required to run the application, but it's not found in docker info."
)
elif gpu is GPUFlag.preffered:
elif gpu is GPUFlag.preferred:
self.logger.warn(
(
f"Runtime {nvidia} not found in docker info, GPU features will be unavailable."
Expand Down Expand Up @@ -463,7 +463,7 @@ def find_or_run_container(self):
if (
is_runtime_err
and (self.docker_runtime == "nvidia")
and (self._gpu_config is GPUFlag.preffered)
and (self._gpu_config is GPUFlag.preferred)
):
self.logger.warn("Can't start docker container. Trying to use another runtime.")
self.docker_runtime = "runc"
Expand Down Expand Up @@ -492,7 +492,7 @@ def find_or_run_container(self):
"Error while trying to start the container "
f"with runtime={orig_runtime}. "
"Check your nvidia drivers, delete gpu flag from application config "
"or reaplace it with gpu=`preffered`. "
"or reaplace it with gpu=`preferred`. "
f"Docker exception message: {clear_msg}"
)
)
Expand Down

0 comments on commit 7f6f9f1

Please sign in to comment.