Skip to content

Raise ARM baseline to ARMv8.4+SVE with modern extensions - #97781

Closed
Algunenano wants to merge 2 commits into
ClickHouse:masterfrom
Algunenano:arm-sve-baseline
Closed

Algunenano wants to merge 2 commits into
ClickHouse:masterfrom
Algunenano:arm-sve-baseline

Conversation

@Algunenano

@Algunenano Algunenano commented Feb 23, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Raise the ARM modern build profile from ARMv8.2 to ARMv8.4, which is the lowest common denominator across all current ARM instances: Graviton 3 (Neoverse V1), Azure Cobalt 100 (Neoverse N2), and GCP Axion (Neoverse V2).
  • Enable SVE (Scalable Vector Extensions) for auto-vectorization — supported by all post-Graviton-2 ARM cores (256-bit on Graviton 3, 128-bit SVE2 superset on the rest). SVE is vector-length agnostic so the same binary works on all.
  • Add +i8mm (int8 matrix multiply), +sha3/+sha512 (hardware crypto), +fp16 (half-precision FP arithmetic).
  • Add -mtune=neoverse-v1 to optimize instruction scheduling for most common core (Graviton 3)
  • Rename NO_ARMV81_OR_HIGHER → NO_ARM_SVE across the codebase to reflect the new baseline.
  • Enable BUILD_SVE and HAVE_C_ARM_SVE_H in vectorscan (Hyperscan) config for ARM, enabling SVE codepaths in the regex engine.
  • Update universal.sh install script to check for sve in /proc/cpuinfo to dispatch between modern and compat builds.

Changelog category (leave one):

  • Performance Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Raise ARM build baseline from ARMv8.2 to ARMv8.4 with SVE, +i8mm, +sha3, +fp16 extensions and Neoverse V1 tuning, enabling better auto-vectorization and hardware-accelerated operations on modern ARM server CPUs (Graviton 3+, Azure Cobalt, GCP Axion).

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

The compat ARM build (NO_ARM_SVE=1, formerly NO_ARMV81_OR_HIGHER) remains available for older hardware. The universal.sh install script automatically selects the appropriate build.

🤖 Generated with Claude Code

…e for Neoverse V1

The modern ARM build profile targeted ARMv8.2 as the lowest common
denominator for Graviton 2 and 3. With only 3 Graviton 2 machines
remaining (0.13% of the ARM fleet), raise the baseline to ARMv8.4
which is supported by all current ARM instances: Graviton 3 (Neoverse
V1), Graviton 4 (Neoverse V2), Azure Cobalt 100 (Neoverse N2), and
GCP Axion (Neoverse V2).

Changes:
- Architecture: `armv8.2-a` -> `armv8.4-a` (subsumes `+dotprod`, `+rcpc`;
  adds `+rcpc2`, `+flagm`)
- New extensions: `+sve` (scalable vector extensions for auto-vectorization),
  `+i8mm` (int8 matrix multiply), `+sha3` (SHA-3/SHA-512 hardware),
  `+fp16` (half-precision FP arithmetic)
- Tuning: `-mtune=neoverse-v1` for the dominant core (93% of ARM fleet)
- Rename `NO_ARMV81_OR_HIGHER` -> `NO_ARM_SVE` across the codebase
- Enable `BUILD_SVE` and `HAVE_C_ARM_SVE_H` in vectorscan config
- Update `universal.sh` install script to check for `sve` in cpuinfo

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@Algunenano Algunenano self-assigned this Feb 23, 2026
@clickhouse-gh

clickhouse-gh Bot commented Feb 23, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [7544b4d]

Summary: ❌

job_name test_name status info comment
Performance Comparison (arm_release, master_head, 1/6) failure
Check Results failure
Performance Comparison (arm_release, master_head, 2/6) failure
Check Results failure
Performance Comparison (arm_release, master_head, 3/6) failure
Check Results failure
Performance Comparison (arm_release, master_head, 5/6) failure
Check Results failure
Performance Comparison (arm_release, master_head, 6/6) failure
Check Results failure
Finish Workflow failure
python3 ./ci/jobs/scripts/workflow_hooks/can_be_merged.py failure

@clickhouse-gh clickhouse-gh Bot added pr-performance Pull request with some performance improvements submodule changed At least one submodule changed in this PR. labels Feb 23, 2026
@Algunenano Algunenano added the ci-performance performance only label Feb 24, 2026
@geldot

geldot commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

Does this impact Apple M4 (ARMv9.2 without SVE)? From a quick glance the patch seems to disable some functionality like GCP and simsimd on ARM platforms lacking SVE. This is a popular architecture for data analysts and those evaluating ClickHouse so probably better to align it with modern server ARM architectures and not the legacy fallback.

@Algunenano

Copy link
Copy Markdown
Member Author

This would impact all Apple products, but from the benchmarks it's clear that it isn't a good choice. I'll try to use this as a reference to know where to dispatch and whether we can tweak some other things in our NEON build

Algunenano added a commit to Algunenano/ClickHouse that referenced this pull request Feb 25, 2026
Add optional ARMv8.2 extensions that are available on all target server
hardware (Graviton 2+, Azure Cobalt 100, GCP Axion, Apple Silicon):

- `+sha3`: SHA3 and SM3 hardware instructions (BCAX, EOR3, RAX1, XAR)
- `+sha512`: SHA-512 and SHA-384 hardware instructions
- `+fp16`: full half-precision FP arithmetic (scalar and NEON)

Also add `-mtune=neoverse-v1` on Linux to tune instruction scheduling
for the Graviton 3 microarchitecture (Neoverse V1), which is the
primary ARM platform in CI and production. The tuning flag only affects
scheduling, not the ISA, so the binary still runs on Graviton 2 and
other ARMv8.2 hardware. The flag is gated on Linux because Apple
Silicon has a completely different pipeline where Neoverse tuning
would be counterproductive.

The install script detection is updated to also check for `sha3`,
`sha512`, and `fphp` so machines lacking these extensions correctly
fall back to the compatibility build.

Ref: ClickHouse#97781

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@Algunenano

Copy link
Copy Markdown
Member Author

Something interesting:

@Algunenano Algunenano closed this Feb 25, 2026
@rienath

rienath commented Feb 26, 2026 •

Copy link
Copy Markdown
Member

@Algunenano interesting. All failed tests give wrong results on l2 distance function. QBit and vector indices use simsimd library to calculate it. There's likely a bug in l2 kernel for SVE in simsimd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-performance performance only pr-performance Pull request with some performance improvements submodule changed At least one submodule changed in this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants