Skip to content

#IS157973/numpy version issue#158036

Closed
Michaelgathara wants to merge 23 commits intopytorch:mainfrom
Michaelgathara:IS157973/numpy-version-issue
Closed

#IS157973/numpy version issue#158036
Michaelgathara wants to merge 23 commits intopytorch:mainfrom
Michaelgathara:IS157973/numpy-version-issue

Conversation

@Michaelgathara
Copy link
Contributor

@Michaelgathara Michaelgathara commented Jul 10, 2025

Fixes #157973

THPUtils_unpackNumberAsBool now recognises numpy.bool_ scalars explicitly (using torch::utils::is_numpy_bool).
If the object is a NumPy boolean, we retrieve its truth value via PyObject_IsTrue and return it, avoiding the previous failing path that attempted to treat it as an integer.

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @amjames

@pytorch-bot
Copy link

pytorch-bot bot commented Jul 10, 2025

🔗 Helpful Links

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

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

✅ You can merge normally! (1 Unrelated Failure)

As of commit dbc9817 with merge base 11a86ad (image):

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

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

@Michaelgathara
Copy link
Contributor Author

@pytorchbot label "topic: not user facing"

@jansel
Copy link
Contributor

jansel commented Jul 11, 2025

@pytorchbot merge

@pytorch-bot
Copy link

pytorch-bot bot commented Jul 11, 2025

This PR needs to be approved by an authorized maintainer before merge.

@jansel
Copy link
Contributor

jansel commented Jul 11, 2025

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Jul 11, 2025
@pytorchmergebot
Copy link
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

@pytorchmergebot
Copy link
Collaborator

The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command
For more information see pytorch-bot wiki.

@Michaelgathara
Copy link
Contributor Author

@jansel On the run that failed, from what I can gather, it seems like it's a compile time instruction count error where the test didn't necessarily fail, but the basic_modules_ListOfLinears_inductor – instruction count dropped by 4.4 % (a “win” but still outside the ±1.5 % band) and the mm_loop_inductor_dynamic_gpu – count rose by 1.52 % (just barely beyond the 1.5 % band). Do you think a re-run of that specific test would fix this or do you think something will have to be changed in the code?

@jansel
Copy link
Contributor

jansel commented Jul 12, 2025

@pytorchbot merge

The job is marked unstable, I think we need to update the expected values.

@pytorchmergebot
Copy link
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

@jansel
Copy link
Contributor

jansel commented Jul 12, 2025

#158177

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.

dynamo+numpy 2.0 issue: TypeError: 'numpy.bool' object cannot be interpreted as an integer

4 participants