forked from NVIDIA/spark-rapids
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a shim provider for Spark 3.2.0 development branch (NVIDIA#1704)
Signed-off-by: Gera Shegalov <gera@apache.org> Add a shim provider for Spark 3.2.0 development branch. Closes NVIDIA#1490 - fix overflows in aggregate buffer for GpuSum by wiring the explicit output column type - unit tests for the new shim - consolidate version profiles in the parent pom
- Loading branch information
1 parent
db09eb4
commit 6614a88
Showing
22 changed files
with
396 additions
and
116 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2021, 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. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>com.nvidia</groupId> | ||
<artifactId>rapids-4-spark-shims_2.12</artifactId> | ||
<version>0.5.0-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
<groupId>com.nvidia</groupId> | ||
<artifactId>rapids-4-spark-shims-spark320_2.12</artifactId> | ||
<name>RAPIDS Accelerator for Apache Spark SQL Plugin Spark 3.2.0 Shim</name> | ||
<description>The RAPIDS SQL plugin for Apache Spark 3.2.0 Shim</description> | ||
<version>0.5.0-SNAPSHOT</version> | ||
|
||
<!-- Set 'spark.version' for the shims layer --> | ||
<!-- Create a separate file 'SPARK_VER.properties' in the jar to save cudf & spark version info --> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-antrun-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>dependency</id> | ||
<phase>generate-resources</phase> | ||
<configuration> | ||
<target> | ||
<mkdir dir="${project.build.directory}/extra-resources"/> | ||
<exec executable="bash" failonerror="true" | ||
output="${project.build.directory}/extra-resources/spark-${spark320.version}-info.properties"> | ||
<arg value="${user.dir}/build/dependency-info.sh"/> | ||
<arg value="${cudf.version}"/> | ||
<arg value="${cuda.version}"/> | ||
<arg value="${spark320.version}"/> | ||
</exec> | ||
</target> | ||
</configuration> | ||
<goals> | ||
<goal>run</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.scalastyle</groupId> | ||
<artifactId>scalastyle-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
|
||
<resources> | ||
<resource> | ||
<!-- Include the properties file to provide the build information. --> | ||
<directory>${project.build.directory}/extra-resources</directory> | ||
</resource> | ||
<resource> | ||
<directory>src/main/resources</directory> | ||
</resource> | ||
</resources> | ||
</build> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.nvidia</groupId> | ||
<artifactId>rapids-4-spark-shims-spark311_${scala.binary.version}</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.spark</groupId> | ||
<artifactId>spark-sql_${scala.binary.version}</artifactId> | ||
<version>${spark320.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
1 change: 1 addition & 0 deletions
1
...320/src/main/resources/META-INF/services/com.nvidia.spark.rapids.SparkShimServiceProvider
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 @@ | ||
com.nvidia.spark.rapids.shims.spark320.SparkShimServiceProvider |
53 changes: 53 additions & 0 deletions
53
shims/spark320/src/main/scala/com/nvidia/spark/rapids/shims/spark320/Spark320Shims.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,53 @@ | ||
/* | ||
* Copyright (c) 2021, 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.shims.spark320 | ||
|
||
import com.nvidia.spark.rapids.ShimVersion | ||
import com.nvidia.spark.rapids.shims.spark311.Spark311Shims | ||
import com.nvidia.spark.rapids.spark320.RapidsShuffleManager | ||
|
||
import org.apache.spark.sql.catalyst.trees.TreeNode | ||
import org.apache.spark.sql.execution.SparkPlan | ||
import org.apache.spark.sql.execution.adaptive.{BroadcastQueryStageExec, ShuffleQueryStageExec} | ||
import org.apache.spark.sql.execution.exchange.ReusedExchangeExec | ||
|
||
class Spark320Shims extends Spark311Shims { | ||
|
||
override def getSparkShimVersion: ShimVersion = SparkShimServiceProvider.VERSION320 | ||
|
||
override def getRapidsShuffleManagerClass: String = { | ||
classOf[RapidsShuffleManager].getCanonicalName | ||
} | ||
|
||
/** | ||
* Case class ShuffleQueryStageExec holds an additional field shuffleOrigin | ||
* affecting the unapply method signature | ||
*/ | ||
override def reusedExchangeExecPfn: PartialFunction[SparkPlan, ReusedExchangeExec] = { | ||
case ShuffleQueryStageExec(_, e: ReusedExchangeExec, _) => e | ||
case BroadcastQueryStageExec(_, e: ReusedExchangeExec, _) => e | ||
} | ||
|
||
/** dropped by SPARK-34234 */ | ||
override def attachTreeIfSupported[TreeType <: TreeNode[_], A]( | ||
tree: TreeType, | ||
msg: String)( | ||
f: => A | ||
): A = { | ||
identity(f) | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...k320/src/main/scala/com/nvidia/spark/rapids/shims/spark320/SparkShimServiceProvider.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,36 @@ | ||
/* | ||
* Copyright (c) 2021, 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.shims.spark320 | ||
|
||
import com.nvidia.spark.rapids.{SparkShims, SparkShimVersion} | ||
|
||
object SparkShimServiceProvider { | ||
val VERSION320 = SparkShimVersion(3, 2, 0) | ||
val VERSIONNAMES: Seq[String] = Seq(VERSION320) | ||
.flatMap(v => Seq(s"$v", s"$v-SNAPSHOT")) | ||
} | ||
|
||
class SparkShimServiceProvider extends com.nvidia.spark.rapids.SparkShimServiceProvider { | ||
|
||
def matchesVersion(version: String): Boolean = { | ||
SparkShimServiceProvider.VERSIONNAMES.contains(version) | ||
} | ||
|
||
def buildShim: SparkShims = { | ||
new Spark320Shims() | ||
} | ||
} |
Oops, something went wrong.