8000 [BE] Do not use `numpy` in `torch._inductor.codegen.cpp` by malfet · Pull Request #109324 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[BE] Do not use numpy in torch._inductor.codegen.cpp #109324

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

Closed
wants to merge 1 commit into from

Conversation

malfet
Copy link
Contributor
@malfet malfet commented Sep 14, 2023

s/numpy.iinfo(numpy.int32)/torch.iinfo(torch.int32)/ as those two are interchangeable

Partially addresses #109387

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @ngimel @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov

`s/numpy.iinfo(numpy.int32)/torch.iinfo(torch.int32)/` as those two are
interchangeable
@pytorch-bot
Copy link
pytorch-bot bot commented Sep 14, 2023

🔗 Helpful Links

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

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

✅ No Failures

As of commit 31af549 with merge base 03e35ef (image):
💚 Looks good so far! There are no failures yet. 💚

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

Copy link
Collaborator
@albanD albanD left a comment

Choose a reason for hiding this comment

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

Thanks!

@malfet
Copy link
Contributor Author
malfet commented Sep 15, 2023

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Sep 15, 2023
@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

@malfet malfet added this to the 2.1.1 milestone Sep 15, 2023
@malfet
Copy link
Contributor Author
malfet commented Sep 15, 2023

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

The merge job was canceled. If you believe this is a mistake, then you can re trigger it through pytorch-bot.

@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

atalman pushed a commit to atalman/pytorch that referenced this pull request Sep 19, 2023
)

`s/numpy.iinfo(numpy.int32)/torch.iinfo(torch.int32)/` as those two are interchangeable

Partially addresses pytorch#109387

Pull Request resolved: pytorch#109324
Approved by: https://github.com/albanD
malfet added a commit that referenced this pull request Sep 19, 2023
Cherrypick of 4ee179c  a9bf103 and fb58a72 into release/2.1 branch

Test plan: `python3 -c "import torch;torch.compile(lambda x:print(x))('Hello World')"`

Fixes #109387 to the release branch

* Fix `ConstantVariable` init method if NumPy is missing

By adding `np is not None` check before `isinstance(value, np.number)`

Partially addresses #109387

* [BE] Do not use `numpy` in `torch._inductor.codegen.cpp` (#109324)

`s/numpy.iinfo(numpy.int32)/torch.iinfo(torch.int32)/` as those two are interchangeable

Partially addresses #109387

Pull Request resolved: #109324
Approved by: https://github.com/albanD

* Use `torch.cumsum` instead of numpy one (#109400)

`s/list(numpy.cumsum(foo))/torch.cumsum(torch.tensor(foo), 0).tolist()/`

Test plan: ` python3 ../test/inductor/test_split_cat_fx_passes.py -v`

Partially addresses #109387

Pull Request resolved: #109400
Approved by: https://github.com/ezyang

---------

Co-authored-by: Nikita Shulga <nshulga@meta.com>
@atalman
Copy link
Contributor
atalman commented Oct 19, 2023

removing from 2.1.1 milestones since this was already meged to 2.1

@atalman atalman removed this from the 2.1.1 milestone Oct 19, 2023
@malfet malfet deleted the malfet/be-do-not-use-numpy-in-codegen-cpp branch January 20, 2024 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0