Skip to content
Closed
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
9 changes: 7 additions & 2 deletions python/pyspark/ml/torch/distributor.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,11 +627,16 @@ def _run_training_on_pytorch_function(
with TorchDistributor._setup_files(train_fn, *args) as (train_file_path, output_file_path):
args = [] # type: ignore
TorchDistributor._run_training_on_pytorch_file(input_params, train_file_path, *args)
if not os.path.exists(output_file_path):
raise RuntimeError(
"TorchDistributor failed during training. "
"View stdout logs for detailed error message."
)
try:
output = TorchDistributor._get_pickled_output(output_file_path)
except FileNotFoundError as e:
except Exception as e:
raise RuntimeError(
"TorchDistributor failed during training. "
"TorchDistributor failed due to a pickling error. "
"View stdout logs for detailed error message."
) from e
return output
Expand Down