-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-23285][K8S] Add a config property for specifying physical executor cores #20553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Kubernetes integration test starting |
|
Test build #87234 has finished for PR 20553 at commit
|
|
Kubernetes integration test status success |
felixcheung
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, minor comment.
Sorry, I missed this PR somehow/ Anyone else want to review this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: it was lower case "cpu" in other config, and no "core"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
Kubernetes integration test starting |
|
Test build #87538 has finished for PR 20553 at commit
|
|
Kubernetes integration test status success |
|
Any comment or concern on this? Is this good to merge? |
docs/running-on-kubernetes.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it reads better without "the amount of", i.e. "Specify a hard limit on CPU cores for the driver pod". Same comment for the below section as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment above is now outdated and can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
docs/running-on-kubernetes.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we mention that this value overrides spark.executor.cores?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
Kubernetes integration test starting |
|
Test build #87625 has finished for PR 20553 at commit
|
|
Kubernetes integration test status success |
|
Kubernetes integration test starting |
|
Test build #87626 has finished for PR 20553 at commit
|
|
Kubernetes integration test status success |
|
How do we plan to support dynamic allocation with k8s? Should we read |
|
also cc @cloud-fan @jerryshao |
|
IIUC the |
|
|
|
What is the default value if it is not configured, how do K8S control the CPU usage by default? Also it seems that user may confuse about how to differentiate between k8s executor cores and executor cores. BTW, do we also need similar k8s driver cores for cluster mode? |
|
The value of |
Do you mean |
|
|
@cloud-fan @jiangxb1987 I assume you're referring to ExecutorAllocationManager.scala#L114-L118 when you refer to @liyinan926, while this might be the least obtrusive way to get Kubernetes mode to have fractional executor cores and not change other backends, it seems to me like separating the notion of a pod's CPU request and |
|
Oops - knew we tried that before. Just paged in the discussion from #20460. Looks like that approach might need revisiting in the 2.4 context, given we're targeting dynamic allocation for the k8s backend as well. |
|
@foxish I think the confusion mostly comes from the property name. I don't think we need to change the semantics of |
|
Can we call this |
|
|
|
Ah never mind sorry - thought we were referring to changing thread count with |
|
Agreed that |
docs/running-on-kubernetes.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Precedence in what sense? This won't override spark.executor.cores when it comes to the number of concurrently running tasks. Think it's better to say that it's distinct from spark.executor.cores.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use fallbackConf here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, there's not a ConfigEntry for spark.executor.cores in core.
|
Kubernetes integration test starting |
|
Test build #88763 has finished for PR 20553 at commit
|
|
Kubernetes integration test status success |
|
Is this OK to merge? |
docs/running-on-kubernetes.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be clear when spark.kubernetes.executor.request.cores is set spark.executor.cores is ignore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
…utor cores As discussed in SPARK-23285, this PR introduces a new configuation property `spark.kubernetes.executor.cores` for specifying the phyiscal CPU cores requested for each executor pod. This is to avoid changing the semantics of `spark.executor.cores` and `spark.task.cpus` and their role in task scheduling, task parallelism, dynamic resource allocation, etc. The new configuraiton property only determines the physical CPU cores available to an executor. An executor can still run multiple tasks simultaneously by using appropriate values for `spark.executor.cores` and `spark.task.cpus`.
foxish
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit. Good to merge after that.
docs/running-on-kubernetes.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The two statements appear a bit redundant - can do with just one probably.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be good to also add typical ways (1.5m, 2.0, 5, etc) in which one can specify this and additionally link to https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/#cpu-units as you've done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
Kubernetes integration test starting |
|
Test build #88826 has finished for PR 20553 at commit
|
|
Kubernetes integration test status success |
|
Merging to master once tests pass. Thanks! |
|
Kubernetes integration test starting |
|
Test build #88830 has finished for PR 20553 at commit
|
|
Kubernetes integration test status success |
…utor cores ## What changes were proposed in this pull request? As mentioned in SPARK-23285, this PR introduces a new configuration property `spark.kubernetes.executor.cores` for specifying the physical CPU cores requested for each executor pod. This is to avoid changing the semantics of `spark.executor.cores` and `spark.task.cpus` and their role in task scheduling, task parallelism, dynamic resource allocation, etc. The new configuration property only determines the physical CPU cores available to an executor. An executor can still run multiple tasks simultaneously by using appropriate values for `spark.executor.cores` and `spark.task.cpus`. ## How was this patch tested? Unit tests. felixcheung srowen jiangxb1987 jerryshao mccheah foxish Author: Yinan Li <[email protected]> Author: Yinan Li <[email protected]> Closes apache#20553 from liyinan926/master.
…utor cores ## What changes were proposed in this pull request? As mentioned in SPARK-23285, this PR introduces a new configuration property `spark.kubernetes.executor.cores` for specifying the physical CPU cores requested for each executor pod. This is to avoid changing the semantics of `spark.executor.cores` and `spark.task.cpus` and their role in task scheduling, task parallelism, dynamic resource allocation, etc. The new configuration property only determines the physical CPU cores available to an executor. An executor can still run multiple tasks simultaneously by using appropriate values for `spark.executor.cores` and `spark.task.cpus`. ## How was this patch tested? Unit tests. felixcheung srowen jiangxb1987 jerryshao mccheah foxish Author: Yinan Li <[email protected]> Author: Yinan Li <[email protected]> Closes apache#20553 from liyinan926/master.
What changes were proposed in this pull request?
As mentioned in SPARK-23285, this PR introduces a new configuration property
spark.kubernetes.executor.coresfor specifying the physical CPU cores requested for each executor pod. This is to avoid changing the semantics ofspark.executor.coresandspark.task.cpusand their role in task scheduling, task parallelism, dynamic resource allocation, etc. The new configuration property only determines the physical CPU cores available to an executor. An executor can still run multiple tasks simultaneously by using appropriate values forspark.executor.coresandspark.task.cpus.How was this patch tested?
Unit tests.
@felixcheung @srowen @jiangxb1987 @jerryshao @mccheah @foxish