Skip to content

try refactor of L2 on simd8float32#3794

Closed
mengdilin wants to merge 2 commits intofacebookresearch:mainfrom
mengdilin:export-D60925434
Closed

try refactor of L2 on simd8float32#3794
mengdilin wants to merge 2 commits intofacebookresearch:mainfrom
mengdilin:export-D60925434

Conversation

@mengdilin
Copy link
Contributor

Differential Revision: D60925434

Mengdi Lin added 2 commits August 20, 2024 06:28
Summary:
Pull Request resolved: facebookresearch#3613

As a demo for Mengdi.

The steps to fully migrate to simdlib are:

1. change all function interfaces to use the generic simd8float32 and friends prototypes -- make sure it compiles on fbcode.

2. make sure it also compiles on ARM

3. see which functions can be mirgrated to only use the generic codepath

4. benchmark if the simd emulated path is competitve with the scalar (for platforms without specific SIMD support)

The rationale here is that there are many SIMD instructions that are straightforward, like adding or subtracting registers, they can be put in common between implementations. The only code that may remain with arch-specific intrinsics is where they way of doing things is very different between AVX and NEON.

Differential Revision: D59395882
Differential Revision: D60925434
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D60925434

@alexanderguzhva
Copy link
Contributor

@mengdilin please use a standard term horizontal_sum() instead of accumulate()

// bit shift by 16 -> uint32_t(v) << 16

// load 8 as i32 and bit shift by 16
simd8uint32 code_256i = load8_16bits_as_uint32(code, i);
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe easier to load as simd32uint8 and cast to simd8uint32

@facebook-github-bot
Copy link
Contributor

Hi @mengdilin!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@mnorris11 mnorris11 closed this Oct 21, 2025
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.

6 participants