You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "WeichenXu123 (via GitHub)" <gi...@apache.org> on 2023/04/11 00:10:39 UTC

[GitHub] [spark] WeichenXu123 commented on a diff in pull request #40695: [SPARK-42994][ML][CONNECT] PyTorch Distributor support Local Mode with GPU

WeichenXu123 commented on code in PR #40695:
URL: https://github.com/apache/spark/pull/40695#discussion_r1162182017


##########
python/pyspark/ml/torch/distributor.py:
##########
@@ -548,12 +560,23 @@ def set_torch_config(context: "BarrierTaskContext") -> None:
                 os.environ["NODE_RANK"] = str(context.partitionId())
                 os.environ["RANK"] = str(context.partitionId())
 
-            def set_gpus(context: "BarrierTaskContext") -> None:
-                if CUDA_VISIBLE_DEVICES in os.environ:
-                    return
+            if local_master:
+                # distributed training on a local mode spark cluster
+                def set_gpus(context: "BarrierTaskContext") -> None:
+                    if CUDA_VISIBLE_DEVICES in os.environ:
+                        return

Review Comment:
   Shall we need this checking ?



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