hhr293 opened a new pull request, #13363:
URL: https://github.com/apache/gluten/pull/13363
## What changes are proposed in this pull request?
- Add reusable function-level ISA specialization in Gluten core, following
ClickHouse's
`TargetSpecific.h` design. Runtime dispatch enables x86-64-v4 without
changing the AVX2
build baseline. It is only enabled where the compiler can also query
that level at
runtime (GCC >= 12 or Clang >= 18); older compilers have no query for
it, and dispatching
on a check weaker than the ISA the target attribute unlocks risks an
illegal instruction,
so those builds compile the baseline only.
- Optimize the FFOR min/max scan using AVX-512 `vpminuq`/`vpmaxuq`,
replacing expensive
AVX2 compare/blend sequences while preserving exact results.
- Retain the scalar fallback for unsupported CPUs, unsupported compilers,
and blocks
smaller than 8 values.
## Performance
Measured on an Intel machine, mean of 3 runs:
| Metric | Improvement |
|---|---:|
| Min/max scan cycles (single-core microbenchmark) | **-35%** |
| TPC-H SF300 q8 wall time | **-2.1%** |
| TPC-H SF300 q9 wall time | **-2.2%** |
Measurements use TAC enabled
(`spark.gluten.sql.columnar.shuffle.typeAwareCompress.enabled=true`),
which is disabled by default.
For four-value inputs, `compress64` remains 5.7% slower than upstream,
which uses an
inlined scalar scan. However, `compress64Impl` produces at most one such
block per call,
when the input count modulo 256 is between 4 and 7.
## How was this patch tested?
- Exact min/max results verified across 2^32 boundaries.
- Tests pass with both AVX-512 dispatch and the baseline-only
configuration.
- The cost of the fallback path was measured by forcing the runtime check
to fail, not on
AVX2-only hardware.
- No changes to the compressed format or decoding behavior.
## Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude claude-opus-5
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]