Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove march=native from pgvector Makefile's OPTFLAGS #7854

Merged
merged 3 commits into from
May 23, 2024

Conversation

Bodobolero
Copy link
Contributor

@Bodobolero Bodobolero commented May 23, 2024

Problem

By default, pgvector compiles with -march=native on some platforms for best performance. However, this can lead to Illegal instruction errors if trying to run the compiled extension on a different machine.

I had this problem when trying to run the Neon compute docker image on MacOS with Apple Silicon with Rosetta.

see https://github.com/pgvector/pgvector/blob/ff9b22977e3ef19866d23a54332c8717f258e8db/README.md?plain=1#L1021

Summary of changes

Pass OPTFLAGS="" to make.

Dockerfile.compute-node Show resolved Hide resolved
@hlinnaka
Copy link
Contributor

-march=native is problematic, but I wonder if we should target some more recent chipset, with e.g. AVX512 support? We are also planning to switch to arm, so maybe revisit this after the switch though.

Copy link

github-actions bot commented May 23, 2024

3108 tests run: 2981 passed, 0 failed, 127 skipped (full report)


Flaky tests (2)

Postgres 15

  • test_crafted_wal_end[last_wal_record_xlog_switch]: debug
  • test_timeline_deletion_with_files_stuck_in_upload_queue: debug

Code coverage* (full report)

  • functions: 31.4% (6451 of 20544 functions)
  • lines: 48.3% (49876 of 103270 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
8110da2 at 2024-05-23T10:16:06.818Z :recycle:

@Bodobolero
Copy link
Contributor Author

-march=native is problematic, but I wonder if we should target some more recent chipset, with e.g. AVX512 support? We are also planning to switch to arm, so maybe revisit this after the switch though.

I plan to do an investigation with respect to the various toolchains on compile flags that optimize for architectures and the impact on performance (if I can get this task added to our team's plan).
For now I would just remove the '-march=native' to get us going.

@Bodobolero Bodobolero enabled auto-merge (squash) May 23, 2024 09:58
@Bodobolero Bodobolero merged commit 95a49f0 into main May 23, 2024
42 of 44 checks passed
@Bodobolero Bodobolero deleted the bodobolero/build-pgvector-compatible branch May 23, 2024 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants