Skip to content

support loongarch elu erf gelu selu#6606

Open
futz12 wants to merge 5 commits intoTencent:masterfrom
futz12:some-activation-opt-on-loongarch
Open

support loongarch elu erf gelu selu#6606
futz12 wants to merge 5 commits intoTencent:masterfrom
futz12:some-activation-opt-on-loongarch

Conversation

@futz12
Copy link
Copy Markdown
Contributor

@futz12 futz12 commented Mar 17, 2026

No description provided.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.22%. Comparing base (7237643) to head (f6d1889).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6606      +/-   ##
==========================================
- Coverage   93.41%   93.22%   -0.19%     
==========================================
  Files         868      784      -84     
  Lines      275540   261017   -14523     
==========================================
- Hits       257391   243346   -14045     
+ Misses      18149    17671     -478     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tencent-adm
Copy link
Copy Markdown
Member

tencent-adm commented Mar 18, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds LoongArch-optimized implementations for several activation/math layers (SELU, GELU, ELU, Erf) and extends the LoongArch LSX/LASX math helper headers with new vector routines needed by those layers.

Changes:

  • Add LoongArch layer implementations for SELU, GELU, ELU, and Erf with LSX/LASX vectorized fast paths plus scalar fallbacks.
  • Extend lsx_mathfun.h with erf_ps and elu_ps, and extend lasx_mathfun.h with elu_ps for LASX.
  • Enable packing support in the new LoongArch layer constructors when LSX is available.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/layer/loongarch/selu_loongarch.h Declares SELU_loongarch layer specialization.
src/layer/loongarch/selu_loongarch.cpp Implements LSX-vectorized SELU forward.
src/layer/loongarch/gelu_loongarch.h Declares GELU_loongarch layer specialization.
src/layer/loongarch/gelu_loongarch.cpp Implements LSX-vectorized GELU (fast and non-fast) forward.
src/layer/loongarch/erf_loongarch.h Declares Erf_loongarch layer specialization.
src/layer/loongarch/erf_loongarch.cpp Implements LSX-vectorized erf forward.
src/layer/loongarch/elu_loongarch.h Declares ELU_loongarch layer specialization.
src/layer/loongarch/elu_loongarch.cpp Implements LASX/LSX-vectorized ELU forward.
src/layer/loongarch/lsx_mathfun.h Adds erf_ps and elu_ps LSX vector helpers.
src/layer/loongarch/lasx_mathfun.h Adds elu_ps LASX vector helper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants