Skip to content

Implement optimized FP16 support for ARM architecture - [MOD-9078] #620

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

Merged
merged 37 commits into from
Apr 7, 2025

Conversation

GuyAv46
Copy link
Collaborator

@GuyAv46 GuyAv46 commented Mar 27, 2025

Describe the changes in the pull request

Implement SVE and NEON (with fp16 fml) ARM optimizations for FLOAT16

Mark if applicable

  • This PR introduces API changes
  • This PR introduces serialization changes

@GuyAv46 GuyAv46 requested a review from dor-forer March 27, 2025 16:31
@GuyAv46 GuyAv46 marked this pull request as ready for review March 27, 2025 16:31
Copy link

codecov bot commented Mar 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.51%. Comparing base (bb41732) to head (cb63b7b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #620      +/-   ##
==========================================
- Coverage   96.55%   96.51%   -0.04%     
==========================================
  Files         106      106              
  Lines        5745     5745              
==========================================
- Hits         5547     5545       -2     
- Misses        198      200       +2     

☔ 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.

@GuyAv46 GuyAv46 requested a review from dor-forer March 30, 2025 13:49
dor-forer
dor-forer previously approved these changes Mar 30, 2025
@alonre24 alonre24 requested a review from lerman25 March 31, 2025 08:05
Copy link
Collaborator

@lerman25 lerman25 left a comment

Choose a reason for hiding this comment

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

Awesome work,
few comments/questions

Base automatically changed from dorer-add-arm-opt-fp32 to main April 2, 2025 15:09
@dor-forer dor-forer dismissed their stale review April 2, 2025 15:09

The base branch was changed.

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 6, 2025
@GuyAv46 GuyAv46 requested a review from lerman25 April 6, 2025 15:44
lerman25
lerman25 previously approved these changes Apr 6, 2025
@GuyAv46 GuyAv46 added this pull request to the merge queue Apr 6, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Apr 6, 2025
@GuyAv46 GuyAv46 enabled auto-merge April 7, 2025 06:41
@GuyAv46 GuyAv46 added this pull request to the merge queue Apr 7, 2025
Merged via the queue into main with commit fcc8d78 Apr 7, 2025
23 checks passed
@GuyAv46 GuyAv46 deleted the guyav-arm_fp16_support branch April 7, 2025 08:41
Copy link

github-actions bot commented Apr 7, 2025

Backport failed for 0.8, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 0.8
git worktree add -d .worktree/backport-620-to-0.8 origin/0.8
cd .worktree/backport-620-to-0.8
git switch --create backport-620-to-0.8
git cherry-pick -x fcc8d78b8ceebf249ab6d273761b379580486032

github-actions bot pushed a commit that referenced this pull request Apr 7, 2025
)

* implement L2 SVE with intermediate casting to f32

* implement IP SVE with f16 ops only

* implements L2 sve with no intermediate casting

* add SVE and SVE2 functions files

* add new files to cmake and use new implementations

* added benchmarks

* fix and switch implementation (due to sve2-only op)

* test with SVE2 intrinsics

* Revert "test with SVE2 intrinsics"

This reverts commit 06dd65c.

* remove redundant implementation

* move to 4 steps per iteration implementations

* add macro cleanup

* fix implementation

* refactor to use 4 accumulators

* added tests

* refactor accumulation

* add initial neon implementation

* fix build flags and file layout

* fix tests

* cleanup and L2 implementation with neon+fp16

* format

* fix test for any arch

* another attempt

* fix test

* rename step functions

* comment-in neon benchmarks

* fix benchmark

* review fixes

* more review fixes

* fixes and cleanup

* fix svwhilelt_b16 calls

* use vbslq_f16

* typo fix

* fix test for OSs that don't support fp16

* added back guards for a specific x86 test

(cherry picked from commit fcc8d78)
Copy link

github-actions bot commented Apr 7, 2025

Successfully created backport PR for 8.0:

github-merge-queue bot pushed a commit that referenced this pull request Apr 7, 2025
…78] (#643)

Implement optimized FP16 support for ARM architecture - [MOD-9078] (#620)

* implement L2 SVE with intermediate casting to f32

* implement IP SVE with f16 ops only

* implements L2 sve with no intermediate casting

* add SVE and SVE2 functions files

* add new files to cmake and use new implementations

* added benchmarks

* fix and switch implementation (due to sve2-only op)

* test with SVE2 intrinsics

* Revert "test with SVE2 intrinsics"

This reverts commit 06dd65c.

* remove redundant implementation

* move to 4 steps per iteration implementations

* add macro cleanup

* fix implementation

* refactor to use 4 accumulators

* added tests

* refactor accumulation

* add initial neon implementation

* fix build flags and file layout

* fix tests

* cleanup and L2 implementation with neon+fp16

* format

* fix test for any arch

* another attempt

* fix test

* rename step functions

* comment-in neon benchmarks

* fix benchmark

* review fixes

* more review fixes

* fixes and cleanup

* fix svwhilelt_b16 calls

* use vbslq_f16

* typo fix

* fix test for OSs that don't support fp16

* added back guards for a specific x86 test

(cherry picked from commit fcc8d78)

Co-authored-by: GuyAv46 <47632673+GuyAv46@users.noreply.github.com>
@GuyAv46
Copy link
Collaborator Author

GuyAv46 commented Apr 7, 2025

/backport

Copy link

github-actions bot commented Apr 7, 2025

Backport failed for 0.8, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 0.8
git worktree add -d .worktree/backport-620-to-0.8 origin/0.8
cd .worktree/backport-620-to-0.8
git switch --create backport-620-to-0.8
git cherry-pick -x fcc8d78b8ceebf249ab6d273761b379580486032

Copy link

github-actions bot commented Apr 7, 2025

Backport failed for 8.0, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 8.0
git worktree add -d .worktree/backport-620-to-8.0 origin/8.0
cd .worktree/backport-620-to-8.0
git switch --create backport-620-to-8.0
git cherry-pick -x fcc8d78b8ceebf249ab6d273761b379580486032

GuyAv46 added a commit that referenced this pull request Apr 7, 2025
)

* implement L2 SVE with intermediate casting to f32

* implement IP SVE with f16 ops only

* implements L2 sve with no intermediate casting

* add SVE and SVE2 functions files

* add new files to cmake and use new implementations

* added benchmarks

* fix and switch implementation (due to sve2-only op)

* test with SVE2 intrinsics

* Revert "test with SVE2 intrinsics"

This reverts commit 06dd65c.

* remove redundant implementation

* move to 4 steps per iteration implementations

* add macro cleanup

* fix implementation

* refactor to use 4 accumulators

* added tests

* refactor accumulation

* add initial neon implementation

* fix build flags and file layout

* fix tests

* cleanup and L2 implementation with neon+fp16

* format

* fix test for any arch

* another attempt

* fix test

* rename step functions

* comment-in neon benchmarks

* fix benchmark

* review fixes

* more review fixes

* fixes and cleanup

* fix svwhilelt_b16 calls

* use vbslq_f16

* typo fix

* fix test for OSs that don't support fp16

* added back guards for a specific x86 test

(cherry picked from commit fcc8d78)
github-merge-queue bot pushed a commit that referenced this pull request Apr 7, 2025
…78] (#644)

* Implement optimized FP16 support for ARM architecture - [MOD-9078] (#620)

* implement L2 SVE with intermediate casting to f32

* implement IP SVE with f16 ops only

* implements L2 sve with no intermediate casting

* add SVE and SVE2 functions files

* add new files to cmake and use new implementations

* added benchmarks

* fix and switch implementation (due to sve2-only op)

* test with SVE2 intrinsics

* Revert "test with SVE2 intrinsics"

This reverts commit 06dd65c.

* remove redundant implementation

* move to 4 steps per iteration implementations

* add macro cleanup

* fix implementation

* refactor to use 4 accumulators

* added tests

* refactor accumulation

* add initial neon implementation

* fix build flags and file layout

* fix tests

* cleanup and L2 implementation with neon+fp16

* format

* fix test for any arch

* another attempt

* fix test

* rename step functions

* comment-in neon benchmarks

* fix benchmark

* review fixes

* more review fixes

* fixes and cleanup

* fix svwhilelt_b16 calls

* use vbslq_f16

* typo fix

* fix test for OSs that don't support fp16

* added back guards for a specific x86 test

(cherry picked from commit fcc8d78)

* fit benchmark macros for 0.8
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.

3 participants