Skip to content

Upgrade stable new_{empty/zeros} that had only dtype argument to full version#169711

Closed
mikaylagawarecki wants to merge 4 commits intogh/mikaylagawarecki/397/basefrom
gh/mikaylagawarecki/397/head
Closed

Upgrade stable new_{empty/zeros} that had only dtype argument to full version#169711
mikaylagawarecki wants to merge 4 commits intogh/mikaylagawarecki/397/basefrom
gh/mikaylagawarecki/397/head

Conversation

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Dec 5, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit c188404 with merge base 5d1459a (image):
💚 Looks good so far! There are no failures yet. 💚

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

mikaylagawarecki added a commit that referenced this pull request Dec 5, 2025
ghstack-source-id: 1c58748
Pull Request resolved: #169711
mikaylagawarecki added a commit that referenced this pull request Dec 5, 2025
ghstack-source-id: 386d37b
Pull Request resolved: #169711
@mikaylagawarecki mikaylagawarecki changed the title Upgrade stable new_{empty/zeros} to full version Upgrade stable new_{empty/zeros} that had only dtype argument to full version Dec 5, 2025
@mikaylagawarecki mikaylagawarecki marked this pull request as ready for review December 5, 2025 21:25
@mikaylagawarecki mikaylagawarecki added ciflow/trunk Trigger trunk jobs on your pull request release notes: cpp release notes category topic: improvements topic category labels Dec 5, 2025
Copy link
Copy Markdown
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.

For post-branch cut: we really need to add documentation for all of these functions we're adding!

mikaylagawarecki added a commit that referenced this pull request Dec 8, 2025
ghstack-source-id: e16f771
Pull Request resolved: #169711
@mikaylagawarecki
Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@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

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

mikaylagawarecki added a commit that referenced this pull request Dec 8, 2025
ghstack-source-id: 066c514
Pull Request resolved: #169711
@mikaylagawarecki
Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@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

@pytorchmergebot
Copy link
Copy Markdown
Collaborator

Merge failed

Reason: Command git -C /home/runner/work/pytorch/pytorch cherry-pick -x 801aeffd82f9c9f130355b59471a846d60d43eea returned non-zero exit code 1

The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:

    git commit --allow-empty

Otherwise, please use 'git cherry-pick --skip'
On branch main
Your branch is ahead of 'origin/main' by 1 commit.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 801aeffd82f.
  (all conflicts fixed: run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

nothing to commit, working tree clean
Details for Dev Infra team Raised by workflow job

@mikaylagawarecki
Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@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

JacobSzwejbka pushed a commit that referenced this pull request Dec 8, 2025
pytorchmergebot pushed a commit that referenced this pull request Dec 8, 2025
Pull Request resolved: #168062
Approved by: https://github.com/albanD
ghstack dependencies: #169703, #169709, #169711
pytorchmergebot pushed a commit that referenced this pull request Dec 9, 2025
…ch_call_dispatcher) (#169872)

Scalar's StableIValue conversion is not supported yet.

If we don't land this we can recommend `fill_(empty(...))` instead

Pull Request resolved: #169872
Approved by: https://github.com/albanD
ghstack dependencies: #169703, #169709, #169711, #168062
liangxs pushed a commit to liangxs/pytorch that referenced this pull request Dec 9, 2025
liangxs pushed a commit to liangxs/pytorch that referenced this pull request Dec 9, 2025
liangxs pushed a commit to liangxs/pytorch that referenced this pull request Dec 9, 2025
…ch_call_dispatcher) (pytorch#169872)

Scalar's StableIValue conversion is not supported yet.

If we don't land this we can recommend `fill_(empty(...))` instead

Pull Request resolved: pytorch#169872
Approved by: https://github.com/albanD
ghstack dependencies: pytorch#169703, pytorch#169709, pytorch#169711, pytorch#168062
pytorchmergebot pushed a commit that referenced this pull request Dec 9, 2025
From https://github.com/pytorch/audio/blob/main/src/libtorchaudio/stable/ops.h

Technically it should have been ok not to port these but looking at these carefully I realized the subtract ported to audio ~would have undefined behavior :/~ is broken

```
inline Tensor subtract(const Tensor& self, const Tensor& other) {
  const auto num_args = 2;
  std::array<StableIValue, num_args> stack{
      torch::stable::detail::from(self), torch::stable::detail::from(other)};
  TORCH_ERROR_CODE_CHECK(torch_call_dispatcher(
      "aten::subtract", "Tensor", stack.data(), TORCH_ABI_VERSION));
  return torch::stable::detail::to<torch::stable::Tensor>(stack[0]);
}
```

as it missed `alpha` the signature for `subtract.Tensor` is  `func: subtract.Tensor(Tensor self, Tensor other, *, Scalar alpha=1) -> Tensor`. ~This is also our bad as although out of bounds reads on the stableivalue stack would be caught by asan, without asan they are silent correctness issues (PR coming to fix).~

Use the old path to support this as we don't support stableivalue conversion for Scalar yet.

Pull Request resolved: #169880
Approved by: https://github.com/albanD
ghstack dependencies: #169703, #169709, #169711, #168062, #169872
skpark-rh pushed a commit to skpark-rh/pytorch that referenced this pull request Dec 10, 2025
skpark-rh pushed a commit to skpark-rh/pytorch that referenced this pull request Dec 10, 2025
skpark-rh pushed a commit to skpark-rh/pytorch that referenced this pull request Dec 10, 2025
…ch_call_dispatcher) (pytorch#169872)

Scalar's StableIValue conversion is not supported yet.

If we don't land this we can recommend `fill_(empty(...))` instead

Pull Request resolved: pytorch#169872
Approved by: https://github.com/albanD
ghstack dependencies: pytorch#169703, pytorch#169709, pytorch#169711, pytorch#168062
skpark-rh pushed a commit to skpark-rh/pytorch that referenced this pull request Dec 10, 2025
…ch#169880)

From https://github.com/pytorch/audio/blob/main/src/libtorchaudio/stable/ops.h

Technically it should have been ok not to port these but looking at these carefully I realized the subtract ported to audio ~would have undefined behavior :/~ is broken

```
inline Tensor subtract(const Tensor& self, const Tensor& other) {
  const auto num_args = 2;
  std::array<StableIValue, num_args> stack{
      torch::stable::detail::from(self), torch::stable::detail::from(other)};
  TORCH_ERROR_CODE_CHECK(torch_call_dispatcher(
      "aten::subtract", "Tensor", stack.data(), TORCH_ABI_VERSION));
  return torch::stable::detail::to<torch::stable::Tensor>(stack[0]);
}
```

as it missed `alpha` the signature for `subtract.Tensor` is  `func: subtract.Tensor(Tensor self, Tensor other, *, Scalar alpha=1) -> Tensor`. ~This is also our bad as although out of bounds reads on the stableivalue stack would be caught by asan, without asan they are silent correctness issues (PR coming to fix).~

Use the old path to support this as we don't support stableivalue conversion for Scalar yet.

Pull Request resolved: pytorch#169880
Approved by: https://github.com/albanD
ghstack dependencies: pytorch#169703, pytorch#169709, pytorch#169711, pytorch#168062, pytorch#169872
@github-actions github-actions Bot deleted the gh/mikaylagawarecki/397/head branch January 8, 2026 02:21
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 release notes: cpp release notes category topic: improvements topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants