WeichenXu123 commented on code in PR #40607:
URL: https://github.com/apache/spark/pull/40607#discussion_r1156563103
##########
python/pyspark/ml/torch/distributor.py:
##########
@@ -554,7 +561,21 @@ def set_gpus(context: "BarrierTaskContext") -> None:
pass
if context.partitionId() == 0:
- yield output
+ output_bytes = cloudpickle.dumps(output)
+ output_size = len(output_bytes)
+
+ # In Spark Connect, DataFrame.collect stacks rows to size
+ # 'spark.connect.grpc.arrow.maxBatchSize' (default 4MiB),
+ # here use 4KiB for each chunk, which mean each arrow batch
+ # may contain about 1000 chunks.
+ chunks = []
+ chunk_size = 4096
Review Comment:
I think we should use larger chunk size, I recommend 256MB .
--
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]