tgravescs commented on code in PR #48963:
URL: https://github.com/apache/spark/pull/48963#discussion_r1866270639
##########
core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala:
##########
@@ -479,6 +479,32 @@ private[spark] object CoarseGrainedExecutorBackend extends
Logging {
driverConf.set(EXECUTOR_ID, arguments.executorId)
cfg.logLevel.foreach(logLevel => Utils.setLogLevelIfNeeded(logLevel))
+ // Set executor memory related config here according to resource profile
+ if (cfg.resourceProfile.id !=
ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID) {
+ cfg.resourceProfile
+ .executorResources
+ .foreach {
+ case (ResourceProfile.OFFHEAP_MEM, request) =>
+ driverConf.set(MEMORY_OFFHEAP_SIZE.key, request.amount.toString
+ "m")
+ if (request.amount > 0) {
+ driverConf.set(MEMORY_OFFHEAP_ENABLED.key, "true")
+ }
+ logInfo(log"Set executor off-heap memory to " +
+ log"${MDC(LogKeys.EXECUTOR_MEMORY_SIZE, request)}")
+ case (ResourceProfile.MEMORY, request) =>
+ driverConf.set(EXECUTOR_MEMORY.key, request.amount.toString +
"m")
+ logInfo(log"Set executor memory to
${MDC(LogKeys.EXECUTOR_MEMORY_SIZE, request)}")
+ case (ResourceProfile.OVERHEAD_MEM, request) =>
+ driverConf.set(EXECUTOR_MEMORY_OVERHEAD.key,
request.amount.toString + "m")
+ logInfo(log"Set executor memory_overhead to " +
+ log"${MDC(LogKeys.EXECUTOR_MEMORY_SIZE, request)}")
Review Comment:
this log message doesn't match (EXECUTOR_MEMORY_SIZE and should be
EXECUTOR_MEMORY_OVERHEAD) and what on executor after its allocated would need
to know the over head memory? probably doesn't hurt to set, I'm just wondering
if something I"m not thinking of and it should have a comment if never really
used
##########
core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala:
##########
@@ -479,6 +479,32 @@ private[spark] object CoarseGrainedExecutorBackend extends
Logging {
driverConf.set(EXECUTOR_ID, arguments.executorId)
cfg.logLevel.foreach(logLevel => Utils.setLogLevelIfNeeded(logLevel))
+ // Set executor memory related config here according to resource profile
+ if (cfg.resourceProfile.id !=
ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID) {
+ cfg.resourceProfile
+ .executorResources
+ .foreach {
+ case (ResourceProfile.OFFHEAP_MEM, request) =>
+ driverConf.set(MEMORY_OFFHEAP_SIZE.key, request.amount.toString
+ "m")
+ if (request.amount > 0) {
+ driverConf.set(MEMORY_OFFHEAP_ENABLED.key, "true")
Review Comment:
this is questionable to me, we haven't supported setting confs yet so I
would expect it to pick up the default config for this. I'd rather see a
separate issue if we want to revisit this behavior.
##########
core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala:
##########
@@ -479,6 +479,32 @@ private[spark] object CoarseGrainedExecutorBackend extends
Logging {
driverConf.set(EXECUTOR_ID, arguments.executorId)
cfg.logLevel.foreach(logLevel => Utils.setLogLevelIfNeeded(logLevel))
+ // Set executor memory related config here according to resource profile
+ if (cfg.resourceProfile.id !=
ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID) {
+ cfg.resourceProfile
+ .executorResources
+ .foreach {
+ case (ResourceProfile.OFFHEAP_MEM, request) =>
+ driverConf.set(MEMORY_OFFHEAP_SIZE.key, request.amount.toString
+ "m")
+ if (request.amount > 0) {
+ driverConf.set(MEMORY_OFFHEAP_ENABLED.key, "true")
+ }
+ logInfo(log"Set executor off-heap memory to " +
+ log"${MDC(LogKeys.EXECUTOR_MEMORY_SIZE, request)}")
+ case (ResourceProfile.MEMORY, request) =>
+ driverConf.set(EXECUTOR_MEMORY.key, request.amount.toString +
"m")
+ logInfo(log"Set executor memory to
${MDC(LogKeys.EXECUTOR_MEMORY_SIZE, request)}")
+ case (ResourceProfile.OVERHEAD_MEM, request) =>
+ driverConf.set(EXECUTOR_MEMORY_OVERHEAD.key,
request.amount.toString + "m")
+ logInfo(log"Set executor memory_overhead to " +
+ log"${MDC(LogKeys.EXECUTOR_MEMORY_SIZE, request)}")
+ case (ResourceProfile.CORES, request) =>
+ driverConf.set(EXECUTOR_CORES.key, request.amount.toString)
+ logInfo(log"Set executor executor cores to " +
Review Comment:
remove one of the "executor" words
--
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]