Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Prepare for -DPy_LIMITED_API flag in pytorch #145764#1627

Merged
janeyx99 merged 3 commits into
mainfrom
prepare-for-enforcement
Jan 27, 2025
Merged

Prepare for -DPy_LIMITED_API flag in pytorch #145764#1627
janeyx99 merged 3 commits into
mainfrom
prepare-for-enforcement

Conversation

@janeyx99
Copy link
Copy Markdown
Contributor

@janeyx99 janeyx99 commented Jan 27, 2025

PyTorch core is going to start enforcing the Py_LIMITED_API flag definition for best practices + sanity whenever the py_limited_api is passed in. This PR prepares AO to smoothly handle that change when the nightly is updated.

PT PR: pytorch/pytorch#145764

Test plan:
This should be a noop for both build and runtime.

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Jan 27, 2025

🔗 Helpful Links

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

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

⏳ No Failures, 1 Pending

As of commit 1be90e8 with merge base 47f96f1 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@facebook-github-bot facebook-github-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 Jan 27, 2025
@janeyx99 janeyx99 changed the title Prepare for enforcement of -DPy_LIMITED_API flag pytorch #145764 Prepare for -DPy_LIMITED_API flag in pytorch #145764 Jan 27, 2025
@janeyx99 janeyx99 added build topic: for developers Use this tag if this PR is mainly developer facing labels Jan 27, 2025
@janeyx99 janeyx99 marked this pull request as ready for review January 27, 2025 22:03
@janeyx99 janeyx99 requested a review from drisspg January 27, 2025 22:03
Comment thread setup.py
"-O3" if not debug_mode else "-O0",
"-fdiagnostics-color=always",
]
extra_compile_args["cxx"].extend(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

good fix

Comment thread setup.py

current_date = datetime.now().strftime("%Y%m%d")

PY3_9_HEXCODE = "0x03090000"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this strange AF to me as a flag

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

lol yea welcome to the undocumented world of python

@janeyx99 janeyx99 merged commit 09dd636 into main Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. topic: for developers Use this tag if this PR is mainly developer facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants