Skip to content
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

Create dummymodule _C instead of using load_library(blah.so) #109

Merged
merged 3 commits into from
Jan 24, 2025

Conversation

janeyx99
Copy link
Contributor

@janeyx99 janeyx99 commented Jan 23, 2025

Following the discussions from the tutorials change, the consensus was to:

  • use Py_LIMITED_API flag to guard against bad non CPython agnostic behavior
  • create a dummy module _C so that the code is importable instead of calling load_library

THE QUESTION IS: do we prefer this approach over the torch.ops.load_library(so_file) approach?

This was tested locally -- tests pass and the wheel is CPython agnostic.

@janeyx99 janeyx99 changed the title Create dummymodule _C instead of using load_library(blahso) Create dummymodule _C instead of using load_library(blah.so) Jan 23, 2025
setup.py Outdated
@@ -38,6 +38,7 @@ def get_extensions():
"cxx": [
"-O3" if not debug_mode else "-O0",
"-fdiagnostics-color=always",
"-DPy_LIMITED_API=0x03090000",
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe a comment here about python 3.9

@janeyx99 janeyx99 merged commit 38ec45e into master Jan 24, 2025
1 of 3 checks passed
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