Skip to content

fix: use ReLU² instead of SiLU in BitNet FFN (fixes #588) - #604

Open
Pranesh Nikhar (praneshnikhar) wants to merge 1 commit into
microsoft:mainfrom
praneshnikhar:fix/588-ffn-relu2
Open

fix: use ReLU² instead of SiLU in BitNet FFN (fixes #588)#604
Pranesh Nikhar (praneshnikhar) wants to merge 1 commit into
microsoft:mainfrom
praneshnikhar:fix/588-ffn-relu2

Conversation

@praneshnikhar

Copy link
Copy Markdown

BitNet b1.58 architecture uses squared ReLU (relu²) in the FFN, but the graph builder was hardcoded to LLM_FFN_SILU.

This caused a ~6x perplexity regression on every backend:

  • x86 I2_S: 99.82 → 17.11 (correct band)
  • ARM TL1: 78.69 → 14.96 (correct band)

The fix is a one-line change in the llama.cpp submodule: LLM_FFN_SILULLM_FFN_RELU_SQR.
LLM_FFN_RELU_SQR already exists in the enum and is implemented in the graph builder.

Depends on: isHuangXin/llama.cpp#3

Closes #588

Fixes microsoft#588 — BitNet b1.58 architecture uses squared ReLU
(relu²) in the FFN, but the graph builder was hardcoded to LLM_FFN_SILU.
This caused ~6x perplexity regression on every backend.

Submodule PR: https://github.com/praneshnikhar/llama.cpp/pull/1
@praneshnikhar

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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.

[Bug]: BitNet FFN uses SILU instead of ReLU² — perplexity 99.8 vs 17.1 on every CPU backend

1 participant