Skip to content

Intercept memcpy with __folly_memcpy in OSS build of Adsim - #195

Closed
Kaiweitu wants to merge 1 commit into
facebookresearch:v2-betafrom
Kaiweitu:export-D79877454-to-v2-beta
Closed

Intercept memcpy with __folly_memcpy in OSS build of Adsim#195
Kaiweitu wants to merge 1 commit into
facebookresearch:v2-betafrom
Kaiweitu:export-D79877454-to-v2-beta

Conversation

@Kaiweitu

@Kaiweitu Kaiweitu commented Aug 8, 2025

Copy link
Copy Markdown

Summary:
This diff makes several changes to the code to intercept memcpy calls with __folly_memcpy in OSS build.

The changes include:

  • Adding a new library folly_memcpy_obj to the CMakeLists.txt files, which compiles the FollyMemcpy.cpp file and includes platform-specific memcpy implementations.
  • Defining the FOLLY_MEMCPY_IS_MEMCPY flag and compiling with AVX2 and march=haswell flags for the folly_memcpy_obj library.
  • Removing the memwrap.cc file, which is no longer needed.

These changes allow the code to use the optimized __folly_memcpy function instead of the standard memcpy function, which better mimic the code in the production system.

Differential Revision: D79877454

Summary:
This diff makes several changes to the code to intercept `memcpy` calls with `__folly_memcpy` in OSS build.

The changes include:

* Adding a new library `folly_memcpy_obj` to the `CMakeLists.txt` files, which compiles the `FollyMemcpy.cpp` file and includes platform-specific memcpy implementations.
* Defining the `FOLLY_MEMCPY_IS_MEMCPY` flag and compiling with AVX2 and march=haswell flags for the `folly_memcpy_obj` library.
* Removing the `memwrap.cc` file, which is no longer needed.

These changes allow the code to use the optimized `__folly_memcpy` function instead of the standard `memcpy` function, which better mimic the code in the production system.

Differential Revision: D79877454
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 8, 2025
@facebook-github-bot

Copy link
Copy Markdown
Contributor

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

facebook-github-bot pushed a commit that referenced this pull request Aug 8, 2025
Summary:
Pull Request resolved: #195

This diff makes several changes to the code to intercept `memcpy` calls with `__folly_memcpy` in OSS build.

The changes include:

* Adding a new library `folly_memcpy_obj` to the `CMakeLists.txt` files, which compiles the `FollyMemcpy.cpp` file and includes platform-specific memcpy implementations.
* Defining the `FOLLY_MEMCPY_IS_MEMCPY` flag and compiling with AVX2 and march=haswell flags for the `folly_memcpy_obj` library.
* Removing the `memwrap.cc` file, which is no longer needed.

These changes allow the code to use the optimized `__folly_memcpy` function instead of the standard `memcpy` function, which better mimic the code in the production system.

Reviewed By: excelle08

Differential Revision: D79877454

fbshipit-source-id: d4e47e5ba643441baa6ad8efaa9d3ffe5737b256
@meta-cla

meta-cla Bot commented Aug 16, 2025

Copy link
Copy Markdown

Hi @Kaiweitu!

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 cla@meta.com. Thanks!

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants