Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[build]
# tokio-console needs this
rustflags = ["--cfg", "tokio_unstable"]

[target.aarch64-unknown-linux-gnu]
rustflags = ["-C", "target-feature=+fp16"]
Comment on lines +8 to +9
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify the correct rustflag for FP16 support on ARM64.

The PR description mentions the error requires "fullfp16", but the config uses target-feature=+fp16. Confirm that this flag is correct and sufficient to resolve the compilation error in gemm-common.

Additionally, consider whether other ARM64 target triples (e.g., aarch64-apple-darwin, aarch64-pc-windows-msvc) require the same configuration, or if this is specific to aarch64-unknown-linux-gnu.


🌐 Web query:

What is the correct Rust/Cargo rustflag to enable fullfp16 or fp16 CPU feature on aarch64?

💡 Result:

Use rustc's target-feature flag with the AArch64 feature name "fullfp16". Example:

  • Environment / Cargo: RUSTFLAGS="-C target-feature=+fullfp16"
  • .cargo/config.toml: [target.] rustflags = ["-C", "target-feature=+fullfp16"]

References: LLVM/Clang show the AArch64 feature name is fullfp16, and rustc accepts target-feature via -C. [1][2]

Sources:
[1] Clang/LLVM aarch64 tests showing "+fullfp16" feature name.
[2] rustc docs: use -C target-feature to enable/disable CPU features.


Correct the rustflag: use +fullfp16 instead of +fp16.

The correct Rust/Cargo rustflag to enable fullfp16 support on aarch64 is target-feature=+fullfp16. The PR currently uses target-feature=+fp16, which is incorrect and will not resolve the gemm-common compilation error.

Lines 8-9 should be:

[target.aarch64-unknown-linux-gnu]
    rustflags = ["-C", "target-feature=+fullfp16"]
🤖 Prompt for AI Agents
In .cargo/config.toml around lines 8 to 9, the rustflags entry incorrectly uses
"target-feature=+fp16"; replace it with the correct feature
"target-feature=+fullfp16" so the aarch64 build enables fullfp16 support (i.e.,
update the rustflags array value to use +fullfp16).

Loading