You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "HyukjinKwon (via GitHub)" <gi...@apache.org> on 2023/02/13 10:32:20 UTC
[GitHub] [spark] HyukjinKwon commented on a diff in pull request #39987: [SPARK-41775][PYTHON][FOLLOWUP] Updating error message for training using PyTorch functions
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org