Performance regression in nightly with target-cpu=native on znver4
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Code
Hi, I have a regression when I try to run benchmarks using the nightly compiler on a crate that does elliptic curve operations:
In this repo: https://github.com/zama-ai/tfhe-rs, on branch v1.0 , in the crate tfhe-zk-pok, running the bench with RUSTFLAGS="-C target-cpu=znver4" cargo +nightly-2025-02-18 bench -p tfhe-zk-pok --bench pke_v2 -- pke_zk_verify_v2::PKEV2.
The machine running the bench is an aws hpc7 with an AMD EPYC 9R14 CPU.
Depending on the bench I get around 30% slower timings.
A bisect shows that the regression was introduced with nightly 2025-02-18. Stable toolchains do not seem to be impacted. The slowdown is only visible with -C target-cpu=znver4.
Version it worked on
All stable toolchains, and nightly before 2025-02-18.
Version with regression
nightly 2025-02-18 and after. The latest one as of today (2025-04-04) also has the regression.
Thank you for your help.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the report in tfhe-rs on branch v1.0 with the tfhe-zk-pok pke_v2 benchmark and the stated nightly toolchain, target CPU, and AWS hpc7 AMD EPYC 9R14 environment. Compare nightly 2025-02-18 and later against stable or an earlier nightly, then narrow the regression to the compiler change introduced by that release. Done means the znver4 benchmark no longer shows the reported slowdown and the regression is covered or explained.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100