Skip to content

PythonArgs::toBool: order cheap mutually exclusive checks first#161455

Closed
swolchok wants to merge 4 commits intogh/swolchok/807/basefrom
gh/swolchok/807/head
Closed

PythonArgs::toBool: order cheap mutually exclusive checks first#161455
swolchok wants to merge 4 commits intogh/swolchok/807/basefrom
gh/swolchok/807/head

Conversation

symbools are not identical with Py_True or PyFalse, so we can do those cheap checks first and at least get plain old bools to go fast

[ghstack-poisoned]
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Aug 26, 2025

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

⏳ No Failures, 1 Pending

As of commit 71172fa with merge base 05eeb29 (image):
💚 Looks good so far! There are no failures yet. 💚

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

swolchok added a commit that referenced this pull request Aug 26, 2025
symbools are not identical with Py_True or PyFalse, so we can do those cheap checks first and at least get plain old bools to go fast

ghstack-source-id: 11a2907
Pull Request resolved: #161455
@swolchok swolchok added the topic: not user facing topic category label Aug 26, 2025
…first"


symbools are not identical with Py_True or PyFalse, so we can do those cheap checks first and at least get plain old bools to go fast.

[ghstack-poisoned]
…first"


symbools are not identical with Py_True or PyFalse, so we can do those cheap checks first and at least get plain old bools to go fast.

[ghstack-poisoned]
…first"


symbools are not identical with Py_True or PyFalse, so we can do those cheap checks first and at least get plain old bools to go fast.

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Aug 29, 2025
symbools are not identical with Py_True or PyFalse, so we can do those cheap checks first and at least get plain old bools to go fast

ghstack-source-id: 5e46973
Pull Request resolved: #161455
if (args[i] == Py_True) {
return true;
}
if (args[i] == Py_False) {
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.

I wonder if we should also check for Py_None here

@swolchok
Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Aug 31, 2025
@pytorchmergebot
Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
…rch#161455)

symbools are not identical with Py_True or PyFalse, so we can do those cheap checks first and at least get plain old bools to go fast.
Pull Request resolved: pytorch#161455
Approved by: https://github.com/Skylion007
ghstack dependencies: pytorch#161301, pytorch#161292, pytorch#161304, pytorch#161308, pytorch#161315, pytorch#161317, pytorch#161328, pytorch#161329, pytorch#161432
mansiag05 pushed a commit to mansiag05/pytorch that referenced this pull request Sep 22, 2025
…rch#161455)

symbools are not identical with Py_True or PyFalse, so we can do those cheap checks first and at least get plain old bools to go fast.
Pull Request resolved: pytorch#161455
Approved by: https://github.com/Skylion007
ghstack dependencies: pytorch#161301, pytorch#161292, pytorch#161304, pytorch#161308, pytorch#161315, pytorch#161317, pytorch#161328, pytorch#161329, pytorch#161432
@github-actions github-actions Bot deleted the gh/swolchok/807/head branch October 1, 2025 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants