Skip to content

Remove avx512dq and avx512vl implication for avx512fp16 #140389

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sayantn
Copy link
Contributor

@sayantn sayantn commented Apr 28, 2025

According to Intel, avx512fp16 requires only avx512bw, but LLVM also enables avx512vl and avx512dq when avx512fp16 is active. This is relic code, and will be fixed in LLVM soon. We should remove this from Rust too asap, especially before the stabilization of AVX512

Related:

@rustbot label O-x86_64 O-x86_32 A-SIMD A-target-feature T-compiler -T-libs
r? @Amanieu

Update: the LLVM fix has been merged

cc @rust-lang/wg-llvm will it be possible to update the rustc llvm version to something after llvm/llvm-project#137450

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. A-SIMD Area: SIMD (Single Instruction Multiple Data) A-target-feature Area: Enabling/disabling target features like AVX, Neon, etc. O-x86_32 Target: x86 processors, 32 bit (like i686-*) (IA-32) O-x86_64 Target: x86-64 processors (like x86_64-*) (also known as amd64 and x64) labels Apr 28, 2025
@rustbot
Copy link
Collaborator

rustbot commented Apr 28, 2025

⚠️ Warning ⚠️

  • Some commits in this PR modify submodules.

@rustbot rustbot removed the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Apr 28, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@sayantn
Copy link
Contributor Author

sayantn commented Apr 28, 2025

cc @a4lg there seems to be some doc errors in the is_riscv_feature_detected macro. Could you look into the pls.

PS: I am quite confused how they weren't caught in the stdarch CI

@sayantn
Copy link
Contributor Author

sayantn commented Apr 28, 2025

On hindsight, this seems like a bug in rustdoc with cg_gcc. Still I am retrying the CI

cc @rust-lang/rustdoc @rust-lang/wg-gcc-backend

edit: not spurious

@rust-log-analyzer

This comment has been minimized.

@a4lg
Copy link
Contributor

a4lg commented Apr 29, 2025

@sayantn
That's odd.

It seems the Linkcheck tool on the CI does its own job and the error itself seems valid.

However, multiple references to a single footnote is mandatory for simplicity of the new macro documentation with the platform guide.
And I thought this is allowed. While duplicate ID for footnote references is not ideal (of course) but at least tested in tests/rustdoc/footnote-reference-in-footnote-def.rs which has two duplicate IDs on footnote references to [^a].
So I suppose this is a rustdoc bug to be fixed (give each reference to a footnote unique ID as a long term solution).

If you prefer the short term solution to pass CI, you may revert rust-lang/stdarch#1779.

@a4lg
Copy link
Contributor

a4lg commented Apr 29, 2025

I created a rustdoc PR #140434 (implementing it was easier than I thought) to enable adopting rust-lang/stdarch#1779 in the future. I'm not sure whether adoption of this PR will result in immediate success (considering the default stage for building docs (stage 0), it might not be immediate) but I hope this is accepted.

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-19 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
#18 exporting to docker image format
#18 sending tarball 20.4s done
#18 DONE 27.0s
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-19]
[CI_JOB_NAME=x86_64-gnu-llvm-19]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
sccache: Listening on address 127.0.0.1:4226
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-19', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'build.print-step-timings', '--enable-verbose-tests', '--set', 'build.metrics', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'rust.lld=false', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--set', 'gcc.download-ci-gcc=true', '--enable-new-symbol-mangling']
configure: build.build          := x86_64-unknown-linux-gnu
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-19/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---
[RUSTC-TIMING] proc_macro test:false 5.572
[RUSTC-TIMING] test test:false 9.428
    Finished `release` profile [optimized] target(s) in 1m 18s
##[endgroup]
[TIMING] core::build_steps::compile::Std { target: x86_64-unknown-linux-gnu, compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu, forced_compiler: true }, crates: [], force_recompile: false, extra_rust_args: ["-Csymbol-mangling-version=v0", "-Cpanic=abort"], is_for_mir_opt_tests: false } -- 78.805
Testing GCC stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
 Downloading crates ...
  Downloaded boml v0.3.1
   Compiling boml v0.3.1
[RUSTC-TIMING] boml test:false 0.778
   Compiling y v0.1.0 (/checkout/compiler/rustc_codegen_gcc/build_system)
[RUSTC-TIMING] y test:false 2.911
    Finished `release` profile [optimized] target(s) in 3.97s
     Running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-codegen/x86_64-unknown-linux-gnu/release/y test --use-backend gcc --gcc-path /checkout/obj/build/x86_64-unknown-linux-gnu/ci-gcc/lib --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/cg_gcc --release --mini-tests --std-tests`
`--gcc-path` was provided, ignoring config file. Using `/checkout/obj/build/x86_64-unknown-linux-gnu/ci-gcc/lib` as path for libgccjit
[BUILD] mini_core
[RUSTC-TIMING] mini_core test:false 0.203
[BUILD] example
[AOT] mini_core_hello_world
[RUSTC-TIMING] mini_core_hello_world test:false 0.182
---
##[endgroup]
[TIMING] core::build_steps::tool::ToolBuild { compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu, tool: "linkchecker", path: "src/tools/linkchecker", mode: ToolBootstrap, source_type: InTree, extra_features: [], allow_features: "", cargo_args: [], artifact_kind: Binary } -- 0.141
[TIMING] core::build_steps::tool::Linkchecker { compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu } -- 0.000
##[group]Testing stage0 Linkcheck (x86_64-unknown-linux-gnu)
std/arch/macro.is_riscv_feature_detected.html:115: id is not unique: `fnref1`
std/arch/macro.is_riscv_feature_detected.html:118: id is not unique: `fnref1`
std/arch/macro.is_riscv_feature_detected.html:123: id is not unique: `fnref1`
std/arch/macro.is_riscv_feature_detected.html:126: id is not unique: `fnref1`
std/arch/macro.is_riscv_feature_detected.html:128: id is not unique: `fnref1`
std/arch/macro.is_riscv_feature_detected.html:128: id is not unique: `fnref2`
std/arch/macro.is_riscv_feature_detected.html:137: id is not unique: `fnref2`
std/arch/macro.is_riscv_feature_detected.html:138: id is not unique: `fnref2`
std/arch/macro.is_riscv_feature_detected.html:139: id is not unique: `fnref2`
std/arch/macro.is_riscv_feature_detected.html:140: id is not unique: `fnref2`
std/arch/macro.is_riscv_feature_detected.html:152: id is not unique: `fnref1`
std/arch/macro.is_riscv_feature_detected.html:152: id is not unique: `fnref2`
std/arch/macro.is_riscv_feature_detected.html:153: id is not unique: `fnref1`
std/arch/macro.is_riscv_feature_detected.html:163: id is not unique: `fnref5`
std/arch/macro.is_riscv_feature_detected.html:171: id is not unique: `fnref2`
std/arch/macro.is_riscv_feature_detected.html:172: id is not unique: `fnref2`
std/arch/macro.is_riscv_feature_detected.html:173: id is not unique: `fnref2`
std/arch/macro.is_riscv_feature_detected.html:174: id is not unique: `fnref2`
std/arch/macro.is_riscv_feature_detected.html:175: id is not unique: `fnref2`
checked links in: 25.1s
number of HTML files scanned: 45810
number of HTML redirects found: 14457
number of links checked: 2515211
number of links ignored due to external: 102531
number of links ignored due to exceptions: 24
number of intra doc links ignored: 9
errors found: 19
found some broken links
Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:38:55
  local time: Tue Apr 29 15:26:16 UTC 2025
  network time: Tue, 29 Apr 2025 15:26:16 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

@a4lg
Copy link
Contributor

a4lg commented Apr 30, 2025

I opened a PR rust-lang/stdarch#1792 that will revert rust-lang/stdarch#1779 for now. If this PR is applied, stdarch should be safely merged into the master branch.

Even if #140434 is merged now, because the CI failure says this is caused by the stage0 compiler, we have to wait the next beta to merge rust-lang/stdarch#1779.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-SIMD Area: SIMD (Single Instruction Multiple Data) A-target-feature Area: Enabling/disabling target features like AVX, Neon, etc. O-x86_32 Target: x86 processors, 32 bit (like i686-*) (IA-32) O-x86_64 Target: x86-64 processors (like x86_64-*) (also known as amd64 and x64) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants