viirya commented on a change in pull request #24374: [SPARK-27366][CORE] 
Support GPU Resources in Spark job scheduling
URL: https://github.com/apache/spark/pull/24374#discussion_r275436862
 
 

 ##########
 File path: core/src/test/scala/org/apache/spark/SparkConfSuite.scala
 ##########
 @@ -403,6 +403,33 @@ class SparkConfSuite extends SparkFunSuite with 
LocalSparkContext with ResetSyst
       assert(thrown.getMessage.contains(key))
     }
   }
+
+  test("spark.task.resource.gpu.count should be multiple of spark.task.cpus") {
+    val conf = new SparkConf()
+    conf.validateSettings()
+
+    // no executor gpus
+    conf.set(GPUS_PER_TASK.key, "2")
+    intercept[SparkException] {
+      conf.validateSettings()
+    }
+
+    // gpus need to be multiple of executor
+    conf.set(GPUS_PER_TASK.key, "3")
+    conf.set(EXECUTOR_GPUS.key, "3")
+    conf.set(EXECUTOR_CORES.key, "4")
+    conf.set(CPUS_PER_TASK.key, "1")
 
 Review comment:
   Based on the requirement at SparkConf, seems we don't allow to 
`set(GPUS_PER_TASK.key, "1")` for this setting, right? But I think it is a 
reasonable case.
   
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to