-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Qualification should mark WriteFiles as supported (#784)
Signed-off-by: Ahmed Hussein (amahussein) <[email protected]> Fixes #783 - WriteFiles exec ius added in Spark3.4.0+ - In fact, the WriteFiles exec will fallback to CPU if the child operator is not supported on GPU. - For simplicity of implementation, the Q tool considers WriteFiles Exec as supported all the time. This should be fine because the child (actual write exec) is evaluated independently.
- Loading branch information
1 parent
0e51d5f
commit 649a356
Showing
14 changed files
with
118 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
core/src/main/scala/com/nvidia/spark/rapids/tool/planparser/WriteFilesExecParser.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright (c) 2024, NVIDIA CORPORATION. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.nvidia.spark.rapids.tool.planparser | ||
|
||
import com.nvidia.spark.rapids.tool.qualification.PluginTypeChecker | ||
|
||
import org.apache.spark.sql.execution.ui.SparkPlanGraphNode | ||
|
||
case class WriteFilesExecParser( | ||
node: SparkPlanGraphNode, | ||
checker: PluginTypeChecker, | ||
sqlID: Long) extends ExecParser { | ||
// WriteFiles was added in Spark3.4+. | ||
// The purpose was to create that operator to contain information from V1 write operators. | ||
// Basically, it is supported IFF its child is supported. The GPU plan will fallBack to the CPU | ||
// if the child is not supported. | ||
// For Q tool, we will treat the WriteFilesExec as supported regardless of the child. | ||
// Then the child is evaluated on its own . This results in the WriteFilesExec being incorrectly | ||
// marked as supported, but the error is should not a big deal since the operator has no | ||
// duration associated with it. | ||
override val fullExecName: String = WriteFilesExecParser.execName + "Exec" | ||
|
||
override def parse: ExecInfo = { | ||
// the WriteFiles does not have duration | ||
val duration = None | ||
val speedupFactor = checker.getSpeedupFactor(fullExecName) | ||
ExecInfo.createExecNoNode( | ||
sqlID, | ||
WriteFilesExecParser.execName, | ||
"", | ||
speedupFactor, | ||
duration, | ||
node.id, opType = OpTypes.WriteExec, true, None) | ||
} | ||
} | ||
|
||
object WriteFilesExecParser { | ||
val execName = "WriteFiles" | ||
def accepts(nodeName: String): Boolean = { | ||
nodeName.contains(execName) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters