HyukjinKwon commented on code in PR #39987:
URL: https://github.com/apache/spark/pull/39987#discussion_r1104269974


##########
python/pyspark/ml/torch/distributor.py:
##########
@@ -613,7 +613,13 @@ 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)
-            output = TorchDistributor._get_pickled_output(output_file_path)
+            try:
+                output = TorchDistributor._get_pickled_output(output_file_path)
+            except FileNotFoundError:
+                raise RuntimeError(
+                    "TorchDistributor failed during training. "
+                    "View stdout logs for detailed error message."
+                )

Review Comment:
   ```suggestion
                   ) from e
   ```



##########
python/pyspark/ml/torch/distributor.py:
##########
@@ -613,7 +613,13 @@ 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)
-            output = TorchDistributor._get_pickled_output(output_file_path)
+            try:
+                output = TorchDistributor._get_pickled_output(output_file_path)
+            except FileNotFoundError:

Review Comment:
   ```suggestion
               except FileNotFoundError as e:
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to