Skip to content

Run tests again native CPU in CI#886

Closed
GraDKh wants to merge 1 commit intomainfrom
dgordon/test_against_native_cpu_in_ci
Closed

Run tests again native CPU in CI#886
GraDKh wants to merge 1 commit intomainfrom
dgordon/test_against_native_cpu_in_ci

Conversation

@GraDKh
Copy link
Copy Markdown
Contributor

@GraDKh GraDKh commented Sep 1, 2025

TL;DR

Enable CPU-specific optimizations for test runs in CI by adding the -C target-cpu=native flag.
Ideally we also need nightly jobs on main without those flags to ensure that portable version is not broken as well.

What changed?

Added the -C target-cpu=native rustflag to both the standard test and all-features test configurations in the CI workflow. This flag instructs the Rust compiler to generate code optimized for the specific CPU architecture of the machine running the tests.

How to test?

Run the CI pipeline and verify that tests complete successfully with the new flags. You can also compare performance metrics between runs with and without the flag to observe potential improvements.

Why make this change?

Using -C target-cpu=native allows the compiler to take advantage of all available CPU features on the CI machines, potentially improving test performance by generating more optimized code. This can lead to faster test execution without changing the actual test behavior or validity.

Copy link
Copy Markdown
Contributor Author

GraDKh commented Sep 1, 2025


How to use the Graphite Merge Queue

Add the label merge-ready to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@GraDKh GraDKh requested review from fkondej and jadnohra September 1, 2025 08:11
@GraDKh GraDKh marked this pull request as ready for review September 1, 2025 08:11
Comment thread .github/workflows/ci.yml
Copy link
Copy Markdown
Contributor

@jadnohra jadnohra left a comment

Choose a reason for hiding this comment

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

We should not break the portable version. So we should have both tests in CI

@fkondej

Copy link
Copy Markdown
Contributor Author

GraDKh commented Sep 1, 2025

We have some kind of combinatoric blowup with the number of targets. To me it is a bit wasteful running all of them in CI. @fkondej Can we make some checks running only before the merge?

@GraDKh GraDKh changed the base branch from main to graphite-base/886 September 1, 2025 10:53
@GraDKh GraDKh force-pushed the dgordon/test_against_native_cpu_in_ci branch from 71ae714 to 1d0e717 Compare September 1, 2025 10:53
@GraDKh GraDKh changed the base branch from graphite-base/886 to dgordon/fix_x64_tests_with_gfni September 1, 2025 10:54
@graphite-app graphite-app bot changed the base branch from dgordon/fix_x64_tests_with_gfni to graphite-base/886 September 2, 2025 14:10
@graphite-app graphite-app bot force-pushed the dgordon/test_against_native_cpu_in_ci branch from 1d0e717 to 8fad546 Compare September 2, 2025 14:11
@graphite-app graphite-app bot changed the base branch from graphite-base/886 to main September 2, 2025 14:12
@graphite-app graphite-app bot force-pushed the dgordon/test_against_native_cpu_in_ci branch from 8fad546 to 58b9fc7 Compare September 2, 2025 14:12
Comment thread .github/workflows/ci.yml
@GraDKh GraDKh force-pushed the dgordon/test_against_native_cpu_in_ci branch from 58b9fc7 to 343d063 Compare September 10, 2025 12:48
@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Sep 10, 2025

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Dmytro Gordon.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@GraDKh GraDKh force-pushed the dgordon/test_against_native_cpu_in_ci branch from 343d063 to 914e75c Compare September 10, 2025 12:48
@cla-bot cla-bot bot added the cla-signed label Sep 10, 2025
@graphite-app
Copy link
Copy Markdown

graphite-app bot commented Sep 10, 2025

Merge activity

  • Sep 10, 12:57 PM UTC: GraDKh added this pull request to the Graphite merge queue.
  • Sep 10, 1:04 PM UTC: CI is running for this pull request on a draft pull request (#1124) due to your merge queue CI optimization settings.
  • Sep 10, 1:14 PM UTC: Merged by the Graphite merge queue via draft PR: #1124.

graphite-app bot pushed a commit that referenced this pull request Sep 10, 2025
### TL;DR

Enable CPU-specific optimizations for test runs in CI by adding the `-C target-cpu=native` flag.
Ideally we also need nightly jobs on `main` without those flags to ensure that portable version is not broken as well.

### What changed?

Added the `-C target-cpu=native` rustflag to both the standard test and all-features test configurations in the CI workflow. This flag instructs the Rust compiler to generate code optimized for the specific CPU architecture of the machine running the tests.

### How to test?

Run the CI pipeline and verify that tests complete successfully with the new flags. You can also compare performance metrics between runs with and without the flag to observe potential improvements.

### Why make this change?

Using `-C target-cpu=native` allows the compiler to take advantage of all available CPU features on the CI machines, potentially improving test performance by generating more optimized code. This can lead to faster test execution without changing the actual test behavior or validity.
@graphite-app graphite-app bot closed this Sep 10, 2025
@graphite-app graphite-app bot deleted the dgordon/test_against_native_cpu_in_ci branch September 10, 2025 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants