Skip to content
Closed
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ jobs:

# Any TPC-DS related updates on this job need to be applied to tpcds-1g job of build_and_test.yml as well
tpcds-1g-gen:
name: "Generate an input dataset for TPCDSQueryBenchmark with SF=1"
if: contains(inputs.class, 'TPCDSQueryBenchmark') || contains(inputs.class, '*')
name: "Generate an TPC-DS dataset with SF=1"
if: contains(inputs.class, 'TPCDSQueryBenchmark') || contains(inputs.class, 'ZStandardBenchmark') || contains(inputs.class, '*')
runs-on: ubuntu-latest
env:
SPARK_LOCAL_IP: localhost
Expand Down Expand Up @@ -98,7 +98,9 @@ jobs:
id: cache-tpcds-sf-1
uses: actions/cache@v4
with:
path: ./tpcds-sf-1
path: |
./tpcds-sf-1
./tpcds-sf-1-text

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the new testing approach, but is it possible to produce tpcds-sf-1-text only when conducting tests on ZStandardBenchmark?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to keep it to make the workflow definition simple, as it only takes a few seconds to generate the dataset

$ time tpcds-kit/tools/dsdgen -DISTRIBUTIONS tpcds-kit/tools/tpcds.idx -SCALE 1 -DIR ~/tpcds-sf-1-text
dsdgen Population Generator (Version 2.13.0)
Copyright Transaction Processing Performance Council (TPC) 2001 - 2020
Warning: This scale factor is valid for QUALIFICATION ONLY
tpcds-kit/tools/dsdgen -DISTRIBUTIONS tpcds-kit/tools/tpcds.idx -SCALE 1 -DIR  7.86s user 0.57s system 99% cpu 8.467 total

key: tpcds-${{ hashFiles('.github/workflows/benchmark.yml', 'sql/core/src/test/scala/org/apache/spark/sql/TPCDSSchema.scala') }}
- name: Checkout tpcds-kit repository
if: steps.cache-tpcds-sf-1.outputs.cache-hit != 'true'
Expand All @@ -118,7 +120,9 @@ jobs:
java-version: ${{ inputs.jdk }}
- name: Generate TPC-DS (SF=1) table data
if: steps.cache-tpcds-sf-1.outputs.cache-hit != 'true'
run: build/sbt "sql/Test/runMain org.apache.spark.sql.GenTPCDSData --dsdgenDir `pwd`/tpcds-kit/tools --location `pwd`/tpcds-sf-1 --scaleFactor 1 --numPartitions 1 --overwrite"
run: |
# build/sbt "sql/Test/runMain org.apache.spark.sql.GenTPCDSData --dsdgenDir `pwd`/tpcds-kit/tools --location `pwd`/tpcds-sf-1 --scaleFactor 1 --numPartitions 1 --overwrite"
Comment thread
pan3793 marked this conversation as resolved.
Outdated
mkdir -p `pwd`/tpcds-sf-1-text && `pwd`/tpcds-kit/tools/dsdgen -DISTRIBUTIONS `pwd`/tpcds-kit/tools/tpcds.idx -SCALE 1 -DIR `pwd`/tpcds-sf-1-text

benchmark:
name: "Run benchmarks: ${{ inputs.class }} (JDK ${{ inputs.jdk }}, Scala ${{ inputs.scala }}, ${{ matrix.split }} out of ${{ inputs.num-splits }} splits)"
Expand All @@ -138,6 +142,7 @@ jobs:
# To prevent spark.test.home not being set. See more detail in SPARK-36007.
SPARK_HOME: ${{ github.workspace }}
SPARK_TPCDS_DATA: ${{ github.workspace }}/tpcds-sf-1
SPARK_TPCDS_DATA_TEXT: ${{ github.workspace }}/tpcds-sf-1-text

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the output data size

total 1.2G
-rw-rw-r-- 1 chengpan chengpan 1.9K May 12 13:58 call_center.dat
-rw-rw-r-- 1 chengpan chengpan 1.6M May 12 13:58 catalog_page.dat
-rw-rw-r-- 1 chengpan chengpan  21M May 12 13:58 catalog_returns.dat
-rw-rw-r-- 1 chengpan chengpan 283M May 12 13:58 catalog_sales.dat     -- used for benchmark
-rw-rw-r-- 1 chengpan chengpan  13M May 12 13:58 customer.dat
-rw-rw-r-- 1 chengpan chengpan 5.3M May 12 13:58 customer_address.dat
-rw-rw-r-- 1 chengpan chengpan  77M May 12 13:58 customer_demographics.dat
-rw-rw-r-- 1 chengpan chengpan 9.9M May 12 13:58 date_dim.dat
-rw-rw-r-- 1 chengpan chengpan   67 May 12 13:58 dbgen_version.dat
-rw-rw-r-- 1 chengpan chengpan 149K May 12 13:58 household_demographics.dat
-rw-rw-r-- 1 chengpan chengpan  328 May 12 13:58 income_band.dat
-rw-rw-r-- 1 chengpan chengpan 226M May 12 13:58 inventory.dat
-rw-rw-r-- 1 chengpan chengpan 4.9M May 12 13:58 item.dat
-rw-rw-r-- 1 chengpan chengpan  37K May 12 13:58 promotion.dat
-rw-rw-r-- 1 chengpan chengpan 1.4K May 12 13:58 reason.dat
-rw-rw-r-- 1 chengpan chengpan 1.1K May 12 13:58 ship_mode.dat
-rw-rw-r-- 1 chengpan chengpan 3.1K May 12 13:58 store.dat
-rw-rw-r-- 1 chengpan chengpan  32M May 12 13:58 store_returns.dat
-rw-rw-r-- 1 chengpan chengpan 371M May 12 13:58 store_sales.dat
-rw-rw-r-- 1 chengpan chengpan 4.9M May 12 13:58 time_dim.dat
-rw-rw-r-- 1 chengpan chengpan  585 May 12 13:58 warehouse.dat
-rw-rw-r-- 1 chengpan chengpan 5.7K May 12 13:58 web_page.dat
-rw-rw-r-- 1 chengpan chengpan 9.4M May 12 13:58 web_returns.dat
-rw-rw-r-- 1 chengpan chengpan 141M May 12 13:58 web_sales.dat
-rw-rw-r-- 1 chengpan chengpan 8.6K May 12 13:58 web_site.dat

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @luben, in this round, I'm trying to use TPCDS-generated data for the zstd compression benchmark.

The data can be generated by the following steps:

And my local test shows that zstd-jni 1.5.6 and 1.5.7 are basically at the same level, and 1.5.7 is a little bit faster in some cases.

steps:
- name: Checkout Spark repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -167,11 +172,13 @@ jobs:
distribution: zulu
java-version: ${{ inputs.jdk }}
- name: Cache TPC-DS generated data
if: contains(inputs.class, 'TPCDSQueryBenchmark') || contains(inputs.class, '*')
if: contains(inputs.class, 'TPCDSQueryBenchmark') || contains(inputs.class, 'ZStandardBenchmark') || contains(inputs.class, '*')
id: cache-tpcds-sf-1
uses: actions/cache@v4
with:
path: ./tpcds-sf-1
path: |
./tpcds-sf-1
./tpcds-sf-1-text
key: tpcds-${{ hashFiles('.github/workflows/benchmark.yml', 'sql/core/src/test/scala/org/apache/spark/sql/TPCDSSchema.scala') }}
- name: Run benchmarks
run: |
Expand All @@ -188,8 +195,8 @@ jobs:
# To keep the directory structure and file permissions, tar them
# See also https://github.com/actions/upload-artifact#maintaining-file-permissions-and-case-sensitive-files
echo "Preparing the benchmark results:"
tar -cvf benchmark-results-${{ inputs.jdk }}-${{ inputs.scala }}.tar `git diff --name-only` `git ls-files --others --exclude=tpcds-sf-1 --exclude-standard`
- name: Upload benchmark results
tar -cvf benchmark-results-${{ inputs.jdk }}-${{ inputs.scala }}.tar `git diff --name-only` `git ls-files --others --exclude=tpcds-sf-1 --exclude=tpcds-sf-1-text --exclude-standard`
- name: Upload benchmark results`
uses: actions/upload-artifact@v4
with:
name: benchmark-results-${{ inputs.jdk }}-${{ inputs.scala }}-${{ matrix.split }}
Expand Down
64 changes: 32 additions & 32 deletions core/benchmarks/ZStandardBenchmark-jdk21-results.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,48 @@
Benchmark ZStandardCompressionCodec
================================================================================================

OpenJDK 64-Bit Server VM 21.0.6+7-LTS on Linux 6.8.0-1020-azure
OpenJDK 64-Bit Server VM 21.0.7+6-LTS on Linux 6.11.0-1013-azure
AMD EPYC 7763 64-Core Processor
Benchmark ZStandardCompressionCodec: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
--------------------------------------------------------------------------------------------------------------------------------------
Compression 10000 times at level 1 without buffer pool 656 668 12 0.0 65591.6 1.0X
Compression 10000 times at level 2 without buffer pool 709 711 2 0.0 70934.6 0.9X
Compression 10000 times at level 3 without buffer pool 814 818 5 0.0 81370.9 0.8X
Compression 10000 times at level 1 with buffer pool 601 603 2 0.0 60100.1 1.1X
Compression 10000 times at level 2 with buffer pool 634 636 2 0.0 63449.9 1.0X
Compression 10000 times at level 3 with buffer pool 748 753 5 0.0 74789.7 0.9X
Benchmark ZStandardCompressionCodec: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
----------------------------------------------------------------------------------------------------------------------------------
Compression 4 times at level 1 without buffer pool 2529 2535 8 0.0 632253134.3 1.0X
Compression 4 times at level 2 without buffer pool 4115 4118 3 0.0 1028851302.5 0.6X
Compression 4 times at level 3 without buffer pool 6074 6076 3 0.0 1518448085.3 0.4X
Compression 4 times at level 1 with buffer pool 2522 2524 3 0.0 630583886.3 1.0X
Compression 4 times at level 2 with buffer pool 4113 4113 1 0.0 1028184629.8 0.6X
Compression 4 times at level 3 with buffer pool 6086 6092 9 0.0 1521521046.0 0.4X

OpenJDK 64-Bit Server VM 21.0.6+7-LTS on Linux 6.8.0-1020-azure
OpenJDK 64-Bit Server VM 21.0.7+6-LTS on Linux 6.11.0-1013-azure
AMD EPYC 7763 64-Core Processor
Benchmark ZStandardCompressionCodec: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------------------------
Decompression 10000 times from level 1 without buffer pool 817 818 1 0.0 81723.2 1.0X
Decompression 10000 times from level 2 without buffer pool 817 818 1 0.0 81729.4 1.0X
Decompression 10000 times from level 3 without buffer pool 817 818 1 0.0 81719.7 1.0X
Decompression 10000 times from level 1 with buffer pool 749 757 14 0.0 74864.9 1.1X
Decompression 10000 times from level 2 with buffer pool 748 749 1 0.0 74789.1 1.1X
Decompression 10000 times from level 3 with buffer pool 748 749 1 0.0 74811.6 1.1X
Benchmark ZStandardCompressionCodec: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
--------------------------------------------------------------------------------------------------------------------------------------
Decompression 4 times from level 1 without buffer pool 865 892 26 0.0 216349447.0 1.0X
Decompression 4 times from level 2 without buffer pool 1158 1168 14 0.0 289602033.8 0.7X
Decompression 4 times from level 3 without buffer pool 1358 1359 1 0.0 339589326.8 0.6X
Decompression 4 times from level 1 with buffer pool 864 872 12 0.0 215879855.5 1.0X
Decompression 4 times from level 2 with buffer pool 1137 1151 19 0.0 284365299.8 0.8X
Decompression 4 times from level 3 with buffer pool 1364 1377 19 0.0 341058819.8 0.6X

OpenJDK 64-Bit Server VM 21.0.6+7-LTS on Linux 6.8.0-1020-azure
OpenJDK 64-Bit Server VM 21.0.7+6-LTS on Linux 6.11.0-1013-azure
AMD EPYC 7763 64-Core Processor
Parallel Compression at level 3: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
Parallel Compression with 0 workers 57 59 1 0.0 447789.9 1.0X
Parallel Compression with 1 workers 42 44 3 0.0 326565.8 1.4X
Parallel Compression with 2 workers 39 41 1 0.0 303072.5 1.5X
Parallel Compression with 4 workers 38 40 1 0.0 295414.4 1.5X
Parallel Compression with 8 workers 40 42 1 0.0 315081.4 1.4X
Parallel Compression with 16 workers 44 46 1 0.0 344861.3 1.3X
Parallel Compression with 0 workers 2009 2017 12 0.0 502134610.8 1.0X
Parallel Compression with 1 workers 1842 1847 7 0.0 460530021.8 1.1X
Parallel Compression with 2 workers 953 958 7 0.0 238284564.0 2.1X
Parallel Compression with 4 workers 710 711 2 0.0 177382308.8 2.8X
Parallel Compression with 8 workers 726 727 1 0.0 181557645.3 2.8X
Parallel Compression with 16 workers 819 829 9 0.0 204650720.0 2.5X

OpenJDK 64-Bit Server VM 21.0.6+7-LTS on Linux 6.8.0-1020-azure
OpenJDK 64-Bit Server VM 21.0.7+6-LTS on Linux 6.11.0-1013-azure
AMD EPYC 7763 64-Core Processor
Parallel Compression at level 9: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
Parallel Compression with 0 workers 158 160 1 0.0 1236127.4 1.0X
Parallel Compression with 1 workers 189 191 2 0.0 1477461.1 0.8X
Parallel Compression with 2 workers 113 118 9 0.0 880537.6 1.4X
Parallel Compression with 4 workers 107 110 2 0.0 837459.4 1.5X
Parallel Compression with 8 workers 114 115 2 0.0 888143.3 1.4X
Parallel Compression with 16 workers 113 116 2 0.0 880682.5 1.4X
Parallel Compression with 0 workers 8184 8195 16 0.0 2045939391.0 1.0X
Parallel Compression with 1 workers 6866 6874 12 0.0 1716507434.0 1.2X
Parallel Compression with 2 workers 3565 3581 22 0.0 891320107.3 2.3X
Parallel Compression with 4 workers 3081 3125 62 0.0 770313696.3 2.7X
Parallel Compression with 8 workers 3540 3578 54 0.0 885106192.2 2.3X
Parallel Compression with 16 workers 3962 3969 10 0.0 990404685.3 2.1X


Loading