zhengruifeng commented on code in PR #40607:
URL: https://github.com/apache/spark/pull/40607#discussion_r1156751693
##########
python/pyspark/ml/torch/distributor.py:
##########
@@ -578,19 +600,23 @@ def _run_distributed_training(
)
self._check_encryption()
self.logger.info(
- f"Started distributed training with {self.num_processes} executor
proceses"
+ f"Started distributed training with {self.num_processes} executor
processes"
)
try:
- result = (
- self.sc.parallelize(range(self.num_tasks), self.num_tasks)
- .barrier()
- .mapPartitions(spark_task_function)
- .collect()[0]
+ rows = (
+ self.spark.range(start=0, end=self.num_tasks, step=1,
numPartitions=self.num_tasks)
+ .mapInPandas(func=spark_task_function, schema="chunk binary",
barrier=True)
+ .collect()
)
+ output_bytes = b""
+ for row in rows:
+ output_bytes += row.chunk
Review Comment:
`join` cause memory issue on master ci, I have another try with `bytearray`
```
pyspark.errors.exceptions.connect.SparkConnectGrpcException:
<_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.UNKNOWN
details = "Java heap space"
debug_error_string = "UNKNOWN:Error received from peer
ipv4:127.0.0.1:35291 {created_time:"2023-04-04T05:17:10.693589954+00:00",
grpc_status:2, grpc_message:"Java heap space"}"
```
--
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]