tgravescs commented on a change in pull request #24634:
[SPARK-27361][YARN][test-hadoop3.2] YARN support for GPU-aware scheduling
URL: https://github.com/apache/spark/pull/24634#discussion_r288743416
##########
File path:
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnSparkHadoopUtil.scala
##########
@@ -39,6 +40,25 @@ object YarnSparkHadoopUtil {
val MEMORY_OVERHEAD_MIN = 384L
val ANY_HOST = "*"
+ val YARN_GPU_RESOURCE_CONFIG = "yarn.io/gpu"
+ val YARN_FPGA_RESOURCE_CONFIG = "yarn.io/fpga"
+
+ /**
+ * Convert Spark resources into YARN resources.
+ * The only resources we know how to map from spark configs to yarn configs
are
+ * gpus and fpgas, everything else the user has to specify them in both the
+ * spark.yarn.*.resource and the spark.*.resource configs.
+ */
+ private[yarn] def getYarnResourcesFromSparkResources(
+ confPrefix: String,
+ sparkConf: SparkConf
+ ): Map[String, String] = {
+ Map("gpu" -> YARN_GPU_RESOURCE_CONFIG, "fpga" ->
YARN_FPGA_RESOURCE_CONFIG).map {
+ case (rName, yarnName) =>
+ val resourceCountSparkConf =
s"${confPrefix}${rName}${SPARK_RESOURCE_COUNT_SUFFIX}"
+ (yarnName ->
sparkConf.getOption(resourceCountSparkConf).getOrElse("0"))
Review comment:
updated
----------------------------------------------------------------
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]