forked from apache/datafusion-comet
-
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.
- Loading branch information
Showing
7 changed files
with
168 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you 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. | ||
--> | ||
|
||
# Comet Benchmarking Guide | ||
|
||
To track progress on performance, we regularly run benchmarks derived from TPC-H and TPC-DS. Benchmarking scripts are | ||
available in the [DataFusion Benchmarks](https://github.com/apache/datafusion-benchmarks) GitHub repository. | ||
|
||
Here is an example command for running the benchmarks. This command will need to be adapted based on the Spark | ||
environment and location of data files. | ||
|
||
This command assumes that `datafusion-benchmarks` is checked out in a parallel directory to `datafusion-comet`. | ||
|
||
```shell | ||
$SPARK_HOME/bin/spark-submit \ | ||
--master "local[*]" \ | ||
--conf spark.driver.memory=8G \ | ||
--conf spark.executor.memory=64G \ | ||
--conf spark.executor.cores=16 \ | ||
--conf spark.cores.max=16 \ | ||
--conf spark.eventLog.enabled=true \ | ||
--conf spark.sql.autoBroadcastJoinThreshold=-1 \ | ||
--jars $COMET_JAR \ | ||
--conf spark.driver.extraClassPath=$COMET_JAR \ | ||
--conf spark.executor.extraClassPath=$COMET_JAR \ | ||
--conf spark.sql.extensions=org.apache.comet.CometSparkSessionExtensions \ | ||
--conf spark.comet.enabled=true \ | ||
--conf spark.comet.exec.enabled=true \ | ||
--conf spark.comet.exec.all.enabled=true \ | ||
--conf spark.comet.cast.allowIncompatible=true \ | ||
--conf spark.comet.explainFallback.enabled=true \ | ||
--conf spark.comet.parquet.io.enabled=false \ | ||
--conf spark.comet.batchSize=8192 \ | ||
--conf spark.comet.columnar.shuffle.enabled=false \ | ||
--conf spark.comet.exec.shuffle.enabled=true \ | ||
--conf spark.shuffle.manager=org.apache.spark.sql.comet.execution.shuffle.CometShuffleManager \ | ||
--conf spark.sql.adaptive.coalescePartitions.enabled=false \ | ||
--conf spark.comet.shuffle.enforceMode.enabled=true \ | ||
../datafusion-benchmarks/runners/datafusion-comet/tpcbench.py \ | ||
--benchmark tpch \ | ||
--data /mnt/bigdata/tpch/sf100-parquet/ \ | ||
--queries ../datafusion-benchmarks/tpch/queries | ||
``` | ||
|
||
Comet performance can be compared to regular Spark performance by running the benchmark twice, once with | ||
`spark.comet.enabled` set to `true` and once with it set to `false`. |
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,60 @@ | ||
<!--- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you 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. | ||
--> | ||
|
||
# Tuning Guide | ||
|
||
Comet provides some tuning options to help you get the best performance from your queries. | ||
|
||
|
||
## Shuffle | ||
|
||
Comet provides Comet shuffle features that can be used to improve the performance of your queries. | ||
The following sections describe the different shuffle options available in Comet. | ||
|
||
To enable Comet shuffle, set the following configuration in your Spark configuration: | ||
|
||
``` | ||
spark.shuffle.manager=org.apache.spark.sql.comet.execution.shuffle.CometShuffleManager | ||
spark.comet.exec.shuffle.enabled=true | ||
``` | ||
|
||
`spark.shuffle.manager` is a Spark static configuration which cannot be changed at runtime. | ||
It must be set before the Spark context is created. You can enable or disable Comet shuffle | ||
at runtime by setting `spark.comet.exec.shuffle.enabled` to `true` or `false`. | ||
Once it is disabled, Comet will fallback to the default Spark shuffle manager. | ||
|
||
### Columnar Shuffle | ||
|
||
By default, once `spark.comet.exec.shuffle.enabled` is enabled, Comet uses columnar shuffle | ||
to improve the performance of shuffle operations. Columnar shuffle supports HashPartitioning, | ||
RoundRobinPartitioning, RangePartitioning and SinglePartitioning. | ||
|
||
Columnar shuffle can be disabled by setting `spark.comet.columnar.shuffle.enabled` to `false`. | ||
|
||
### Native Shuffle | ||
|
||
Comet also provides a fully native shuffle implementation that can be used to improve the performance. | ||
To enable native shuffle, just disable `spark.comet.columnar.shuffle.enabled`. | ||
|
||
Native shuffle only supports HashPartitioning and SinglePartitioning. | ||
|
||
|
||
|
||
|
||
|
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