Skip to content

GH-50503: [Parquet] Remove SVE128 unpack#50611

Open
AntoinePrv wants to merge 3 commits into
apache:mainfrom
AntoinePrv:sve-fix
Open

GH-50503: [Parquet] Remove SVE128 unpack#50611
AntoinePrv wants to merge 3 commits into
apache:mainfrom
AntoinePrv:sve-fix

Conversation

@AntoinePrv

@AntoinePrv AntoinePrv commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Rationale for this change

The SVE128 code path has conflict with the SVE256 that we do not yet manage properly.

Anyhow, after we fixed the inlining issue in Neon, the SVE128 had no clear advantages over Neon as expected, os this was due to be removed anyways.

What changes are included in this PR?

Remove SVE128 unpack

Are these changes tested?

In CI.

Are there any user-facing changes?

No

@github-actions github-actions Bot added the awaiting review Awaiting review label Jul 23, 2026
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #50503 has been automatically assigned in GitHub to PR creator.

@raulcd

raulcd commented Jul 23, 2026

Copy link
Copy Markdown
Member

@github-actions crossbow submit wheel-manylinux-2-28-cp313-cp313-arm64

@github-actions

Copy link
Copy Markdown

Revision: 84f8209

Submitted crossbow builds: ursacomputing/crossbow @ actions-8af012a39a

Task Status
wheel-manylinux-2-28-cp313-cp313-arm64 GitHub Actions

@AntoinePrv

Copy link
Copy Markdown
Collaborator Author

@github-actions crossbow submit wheel-manylinux-2-28-cp313-cp313-arm64

@github-actions

Copy link
Copy Markdown

Revision: 3458a70

Submitted crossbow builds: ursacomputing/crossbow @ actions-b71ab30610

Task Status
wheel-manylinux-2-28-cp313-cp313-arm64 GitHub Actions

@raulcd

raulcd commented Jul 23, 2026

Copy link
Copy Markdown
Member

The wheel can be downloaded from the summary page artifacts on the job:
https://github.com/ursacomputing/crossbow/actions/runs/29994419195

@pitrou

pitrou commented Jul 23, 2026

Copy link
Copy Markdown
Member

Can we try to understand what happens? For example look for symbols with sve in them but no sve128 or sve256.

@AntoinePrv

Copy link
Copy Markdown
Collaborator Author

The best hypothesis I have goes as follows (this was heavily AI assisted):

We had a similar problem with the ODR violation, but the cause is different here (latest xsimd has the ODR fix).
The issue arise during LTO where the fags -msve-vector-bits=128 and -msve-vector-bits=256 get conflated, resulting in the 256 version making 128 bits assumptions.
The supporting evidence is the presence of ptrue p7.b, vl16 in unpack_sve256: this sets a predicate (all true since we don't use them) only to 16 bytes (128 bits).

While there is some uncertainty in this diagnosis, the presence of both sve128 and sve256 is an extremely likely enabler of the issue. Given I had plan to remove the SVE128 because it did not bring much over Neon, landing this fix has no drawbacks.

@AntoinePrv
AntoinePrv marked this pull request as ready for review July 23, 2026 12:10
@AntoinePrv
AntoinePrv requested a review from pitrou as a code owner July 23, 2026 12:10
Copilot AI review requested due to automatic review settings July 23, 2026 12:10

Copilot AI left a comment

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.

Pull request overview

Removes the SVE128-specific bit-unpacking implementation and associated runtime-dispatch hooks in Arrow C++’s bpacking utility to avoid conflicts with SVE256 (ODR/LTO concerns) and to simplify the SIMD surface area for Parquet decode-related paths.

Changes:

  • Removed SVE128 from bpacking dynamic dispatch target list.
  • Deleted the SVE128 “128_alt” implementation and removed its build wiring.
  • Dropped SVE128-specific unit test and benchmark coverage.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
cpp/src/arrow/util/bpacking.cc Removes SVE128 from runtime dispatch targets for unpack.
cpp/src/arrow/util/bpacking_test.cc Removes the SVE128-specific unpack test.
cpp/src/arrow/util/bpacking_simd_internal.h Removes SVE128 “ALT” unpack declarations/exports.
cpp/src/arrow/util/bpacking_simd_128_alt.cc Deletes the SVE128 unpack implementation translation unit.
cpp/src/arrow/util/bpacking_benchmark.cc Removes the SVE128 unpack benchmark.
cpp/src/arrow/CMakeLists.txt Stops building the SVE128 unpack source file for Arrow util sources.

@raulcd

raulcd commented Jul 23, 2026

Copy link
Copy Markdown
Member

should we try building a wheel without LTO and validate?

@AntoinePrv

AntoinePrv commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator Author

should we try building a wheel without LTO and validate?

We can, though it would be a worse fix IMHO.

@pitrou

pitrou commented Jul 23, 2026

Copy link
Copy Markdown
Member

The best hypothesis I have goes as follows (this was heavily AI assisted):

We had a similar problem with the ODR violation, but the cause is different here (latest xsimd has the ODR fix). The issue arise during LTO where the fags -msve-vector-bits=128 and -msve-vector-bits=256 get conflated, resulting in the 256 version making 128 bits assumptions.

We should find out why. Can we enable CMAKE_VERBOSE_MAKEFILE on the manylinux build to see all the compiler options for each file? Normally only one -msve-vector-bits is passed for each compilation unit.

@pitrou

pitrou commented Jul 23, 2026

Copy link
Copy Markdown
Member

Looking at the original build logs, bpacking_simd_128.cc is compiled inside a unity build compilation unit, which doesn't seem right. It should be compiled independently, just like bpacking_simd_256.cc.

Edit: my bad, it's for NEON.

@pitrou

pitrou commented Jul 23, 2026

Copy link
Copy Markdown
Member

Ok, I think the issue is https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121412 .

And specifically:

That said, -fno-lto for "mismatched" TUs is the workaroud that, unfortunately, has to be applied on the users side at this point.

@pitrou

pitrou commented Jul 24, 2026

Copy link
Copy Markdown
Member

#50618 removes LTO for SVE-enabled translation units and works fine as per @cyb70289

Let's see whether the benchmarks are affected.

@raulcd

raulcd commented Jul 24, 2026

Copy link
Copy Markdown
Member

@ursabot please benchmark

@rok

rok commented Jul 24, 2026

Copy link
Copy Markdown
Member

Benchmark runs are scheduled for commit 3458a70. Watch https://buildkite.com/apache-arrow and https://conbench.arrow-dev.org for updates. A comment will be posted here when the runs are complete.

@AntoinePrv

Copy link
Copy Markdown
Collaborator Author

Do we have SVE benchmarks?

@pitrou

pitrou commented Jul 24, 2026

Copy link
Copy Markdown
Member

Everything that relies on bit-unpacking, i.e. some Parquet reading benchmarks.

@conbench-apache-arrow

Copy link
Copy Markdown

Thanks for your patience. Conbench analyzed the 4 benchmarking runs that have been run so far on PR commit 3458a70.

There were 4 benchmark results indicating a performance regression:

The full Conbench report has more details.

@raulcd

raulcd commented Jul 24, 2026

Copy link
Copy Markdown
Member

The regression for mac-arm seems to be quite significant.

@rok

rok commented Jul 24, 2026

Copy link
Copy Markdown
Member

The regression for mac-arm seems to be quite significant.

It appears similar regression occurs occasionally. I'll restart the benchmark.

@rok

rok commented Jul 24, 2026

Copy link
Copy Markdown
Member

@ursabot please benchmark

@rok

rok commented Jul 24, 2026

Copy link
Copy Markdown
Member

Commit 3458a70 already has scheduled benchmark runs.

@rok

rok commented Jul 24, 2026

Copy link
Copy Markdown
Member

@AntoinePrv could you push an empty commit so conbench can be started again? (It allows only one benchmark run per commit).

@AntoinePrv

Copy link
Copy Markdown
Collaborator Author

@ursabot please benchmark

@rok

rok commented Jul 24, 2026

Copy link
Copy Markdown
Member

Benchmark runs are scheduled for commit e84d38f. Watch https://buildkite.com/apache-arrow and https://conbench.arrow-dev.org for updates. A comment will be posted here when the runs are complete.

@AntoinePrv

Copy link
Copy Markdown
Collaborator Author

The regression for mac-arm seems to be quite significant.

It appears similar regression occurs occasionally. I'll restart the benchmark.

Yes, MacOS has no reason to be affected by this (it cannot even run the code we removed), so this one is definitely spurious.

@conbench-apache-arrow

Copy link
Copy Markdown

Thanks for your patience. Conbench analyzed the 4 benchmarking runs that have been run so far on PR commit e84d38f.

There was 1 benchmark result indicating a performance regression:

The full Conbench report has more details.

@rok

rok commented Jul 25, 2026

Copy link
Copy Markdown
Member

No more macOS regressions, I think it's just noisy and TouchArea similarly so.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants