Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions plugins/flytekit-kf-pytorch/flytekitplugins/kfpytorch/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from flytekit.configuration import SerializationSettings
from flytekit.core.resources import convert_resources_to_resource_model
from flytekit.extend import IgnoreOutputs, TaskPlugins
from flytekit.loggers import logger

TORCH_IMPORT_ERROR_MESSAGE = "PyTorch is not installed. Please install `flytekitplugins-kfpytorch['elastic']`."

Expand Down Expand Up @@ -274,6 +275,15 @@ def _execute(self, **kwargs) -> Any:
else:
nproc = self.task_config.nproc_per_node

dist_env_vars_set = os.environ.get("PET_NNODES") is not None
if not dist_env_vars_set and self.min_nodes > 1:
logger.warning(
(
f"`nnodes` is set to {self.task_config.nnodes} in elastic task but execution appears "
"to not run in a `PyTorchJob`. Rendezvous might timeout."
)
)

config = LaunchConfig(
run_id=flytekit.current_context().execution_id.name,
min_nodes=self.min_nodes,
Expand Down