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/05/02 11:02:21 UTC

[GitHub] [spark] HyukjinKwon commented on a diff in pull request #40724: [SPARK-43081] [ML] [CONNECT] Add torch distributor data loader that loads data from spark partition data

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


##########
python/pyspark/ml/torch/distributor.py:
##########
@@ -668,13 +668,17 @@ def _setup_files(train_fn: Callable, *args: Any, **kwargs) -> Generator[Tuple[st
     @contextmanager
     def _setup_spark_partition_data(partition_data_iterator, input_schema_json):
         from pyspark.sql.pandas.serializers import ArrowStreamSerializer
+        from pyspark.files import SparkFiles
         import json
 
         if input_schema_json is None:
             yield
             return
 
-        save_dir = TorchDistributor._create_save_dir()
+        # We need to temporarily write partition data into a temp dir,
+        # partition data might be huge, so we need to write it under
+        # configured `SPARK_LOCAL_DIRS`.
+        save_dir = TorchDistributor._create_save_dir(root_dir=SparkFiles.getRootDirectory())

Review Comment:
   LGTM



-- 
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