Skip to content
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

[SPARK-48210][DOC]Modify the description of whether dynamic partition… #46496

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

guixiaowen
Copy link
Contributor

…ing is enabled in the “ Stage Level Scheduling Overview”

What changes were proposed in this pull request?

“ Stage Level Scheduling Overview ” in running-on-yarn and running-on-kubernetes

The description of dynamic partitioning is inconsistent with the code implementation verification.

In running-on-yarn

'

When dynamic allocation is disabled: It allows users to specify different task resource requirements at the stage level and will use the same executors requested at startup.
'

But the implementation is:

Class:ResourceProfileManager

Fuc:isSupported

private[spark] def isSupported(rp: ResourceProfile): Boolean = {
assert(master != null)
if (rp.isInstanceOf[TaskResourceProfile] && !dynamicEnabled) {
if ((notRunningUnitTests || testExceptionThrown) &&
!(isStandaloneOrLocalCluster || isYarn || isK8s))

{ throw new SparkException("TaskResourceProfiles are only supported for Standalone, " + "Yarn and Kubernetes cluster for now when dynamic allocation is disabled.") }
}

The judgment of this code is that it does not support TaskResourceProfile in Yarn and k8s when dynamic partitioning is closed.

The description in the document does not match, so the document needs to be modified.

Why are the changes needed?

This description is a bit misleading for users.

Does this PR introduce any user-facing change?

How was this patch tested?

Was this patch authored or co-authored using generative AI tooling?

…ing is enabled in the “ Stage Level Scheduling Overview”
@github-actions github-actions bot added the DOCS label May 9, 2024
@guixiaowen
Copy link
Contributor Author

@cloud-fan hi, Can you help me review this PR?

@guixiaowen guixiaowen changed the title [SPARK-48210][doc]Modify the description of whether dynamic partition… [SPARK-48210][DOC]Modify the description of whether dynamic partition… May 9, 2024
@dongjoon-hyun
Copy link
Member

cc @mridulm and @tgravescs

@tgravescs
Copy link
Contributor

sorry this description is very hard to read. I think you are trying to say that stage level scheduling isn't supported on k8s and yarn when dynamic allocation is disabled? When you say dynamic partitions do you mean dynamic allocation of executors?

That is not true we added support - https://issues.apache.org/jira/browse/SPARK-45495

The description as is:

  • When dynamic allocation is disabled: It allows users to specify different task resource requirements at the stage level and will use the same executors requested at startup.

Is correct. When dynamic allocation is off, you can specify a different resource profile that changes the task requiresments but uses the existing executors.

@guixiaowen
Copy link
Contributor Author

guixiaowen commented May 11, 2024

sorry this description is very hard to read. I think you are trying to say that stage level scheduling isn't supported on k8s and yarn when dynamic allocation is disabled? When you say dynamic partitions do you mean dynamic allocation of executors?

That is not true we added support - https://issues.apache.org/jira/browse/SPARK-45495

The description as is:

  • When dynamic allocation is disabled: It allows users to specify different task resource requirements at the stage level and will use the same executors requested at startup.

Is correct. When dynamic allocation is off, you can specify a different resource profile that changes the task requiresments but uses the existing executors.

@tgravescs Thank you for your reply.

Can you help me check my configuration, code, and error messages returned.

Is there a problem with my understanding?

My set is:
set spark.dynamicAllocation.enabled=false

My code is:
`
import org.apache.spark.resource.ResourceProfileBuilder
import org.apache.spark.resource.TaskResourceRequests

val rdd = sc.range(0, 9)
val rpBuilder = new ResourceProfileBuilder()
val taskReqs = new TaskResourceRequests().cpus(1)
val rp = rpBuilder.require(taskReqs).build
rdd.withResources(rp)
`

Return info:

`
org.apache.spark.SparkException: TaskResourceProfiles are only supported for Standalone cluster for now when dynamic allocation is disabled.
at org.apache.spark.resource.ResourceProfileManager.isSupported(ResourceProfileManager.scala:71)
at org.apache.spark.resource.ResourceProfileManager.addResourceProfile(ResourceProfileManager.scala:126)
at org.apache.spark.rdd.RDD.withResources(RDD.scala:1829)
... 48 elided

`
According to the document description, is 'specify different task resource requirements ' set TaskResourceRequests?


When dynamic allocation is disabled: It allows users to specify different task resource requirements at the stage level and will use the same executors requested at startup.

Is there a problem with my understanding?
Can you help me answer this? Thank you.

@tgravescs
Copy link
Contributor

what version of Spark are you using? That issue I pointed to was fixed in 4.0.0 and 3.5.1.

The check and error that is on the main branch should read:

      if ((notRunningUnitTests || testExceptionThrown) &&
        !(isStandaloneOrLocalCluster || isYarn || isK8s)) {
        throw new SparkException("TaskResourceProfiles are only supported for Standalone, " +
          "Yarn and Kubernetes cluster for now when dynamic allocation is disabled.")

https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/resource/ResourceProfileManager.scala#L73

I'm guessing you are using a version of Spark before that change.

@guixiaowen
Copy link
Contributor Author

what version of Spark are you using? That issue I pointed to was fixed in 4.0.0 and 3.5.1.

The check and error that is on the main branch should read:

      if ((notRunningUnitTests || testExceptionThrown) &&
        !(isStandaloneOrLocalCluster || isYarn || isK8s)) {
        throw new SparkException("TaskResourceProfiles are only supported for Standalone, " +
          "Yarn and Kubernetes cluster for now when dynamic allocation is disabled.")

https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/resource/ResourceProfileManager.scala#L73

I'm guessing you are using a version of Spark before that change.

@tgravescs
I tested on 3.5.1 and main branch (4.0.0)
The results of these two branch tests are the same. The code is restricted, but the documentation states that it is possible to enable it.
This place is a bit contradictory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants