Repository navigation
Conversation
Introduce _mm512_rcp14_sigmoid_ps and _mm512_rcp14_silu_ps as AVX512 primitives, with fast_sigmoid/fast_silu fVec wrappers that delegate to them. Reuse the sigmoid primitive in norm.cpp gated AVX512 apply_gate. Co-authored-by: Ma Mingfei <[email protected]>
- Add fast_sigmoid_glu and _mm512_deinterleave_ps helpers in vec.h - AVX512 BF16 specialization for clamp_sigmoid_and_mul_stub (MXFP4 swiglu) - Replace vdivps sigmoid patterns with fast_sigmoid/fast_silu across MoE, activation, topk, norm, mamba, and gemm CPU kernels - Fix clamp_sigmoid_and_mul_stub loop bound (2 * size input elements) Co-authored-by: Ma Mingfei <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds merged AVX512 +
at::vec::Vectorized<float>fast math helpers and applies them across CPU hot paths.Primitives (
vec.h)_mm512_rcp14_sigmoid_ps/_mm512_rcp14_silu_ps/_mm512_rcp14_sigmoid_glu_ps_mm512_deinterleave_psfor interleaved gate/linear layoutsfast_sigmoid/fast_silu/fast_sigmoid_glufVec wrappersHot path optimizations
clamp_sigmoid_and_mul_stub: AVX512 BF16 fast path (MXFP4 swiglu),rcp14+ vectorized deinterleave; generic path usesfast_sigmoid_glusilu_and_mul_stub, MoE tinygemm (moe.cpp,moe_int8.cpp), activation, topk, mamba conv/fla, gemm: replacevdivpssigmoid withfast_*/_mm512_rcp14_*Bug fix
clamp_sigmoid_and_mul_stubloop bound corrected to2 * size(interleaved input is 2× output width)Next steps
clamp_sigmoid_and_mul_stubCI States
Latest PR Test (Base): ❌ Run #29390969628
Latest PR Test (Extra): ❌ Run #29390969428