diff --git a/setup.py b/setup.py index b7334631a..e2462ae13 100644 --- a/setup.py +++ b/setup.py @@ -117,6 +117,7 @@ def get_extensions(): extension( "torchao._C", sources, + py_limited_api=True, extra_compile_args=extra_compile_args, extra_link_args=extra_link_args, ) @@ -139,4 +140,7 @@ def get_extensions(): long_description_content_type="text/markdown", url="https://github.com/pytorch-labs/ao", cmdclass={"build_ext": BuildExtension}, + options={"bdist_wheel": { + "py_limited_api": "cp39" + }}, )