Skip to content

Conversation

metascroy
Copy link
Contributor

This PR:

  • Moves torchao/experimental/kernels -> torchao/csrc/cpu/torch_free_kernels. This directory houses CPU kernels that do not depend on torch and are written with raw pointers.

  • Moves torchao/experimental/ops -> torchao/csrc/cpu/shared_kernels. This directory houses CPU kernels that are shared between ATen and ExecuTorch, and can be built for either runtime based on compile-time flags.

In addition, it:

  • Fixes include paths and CMake files to make the above changes buildable.
  • Adjusts setup.py

The PR is on the larger side, but most changes are not meaningful. For review, I suggest focusing on the changes to setup.py.

Test plan: CI tests

Copy link

pytorch-bot bot commented Aug 25, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/2868

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 79f1e3e with merge base 23f8a22 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@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 25, 2025
@metascroy metascroy added the topic: not user facing Use this tag if you don't want this PR to show up in release notes label Aug 25, 2025
@metascroy metascroy marked this pull request as ready for review August 25, 2025 18:19
@@ -19,10 +19,6 @@ void torchao::parallel_1d(const int64_t begin, const int64_t end, const F& f) {
});
}

inline void torchao::set_num_threads(int num_threads) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing these because code in csrc should have a path to being torch-agnostic, and there are not plans to support set_num_threads. Note this function is not actually used by the kernels, so we can just delete it.

@facebook-github-bot
Copy link
Contributor

@metascroy has imported this pull request. If you are a Meta employee, you can view this in D80958790.

@facebook-github-bot
Copy link
Contributor

@metascroy has imported this pull request. If you are a Meta employee, you can view this in D80958790.

@facebook-github-bot
Copy link
Contributor

@metascroy has imported this pull request. If you are a Meta employee, you can view this in D80958790.

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. topic: not user facing Use this tag if you don't want this PR to show up in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants