Skip to content

Conversation

@drisspg
Copy link
Contributor

@drisspg drisspg commented Aug 26, 2022

Summary

  • Document contiguous offset construction
  • Expand offsets by 1 so that storage offsets for ntensor[i] = offsets[i+1] - offsets[i]

Another simple one. While looking into this issue #84082 I noticed that the kernels essentially rebuild the offsets but with the added last element. I added this and also cleaned up the code a little

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Aug 26, 2022

🔗 Helpful links

✅ No Failures (0 Pending)

As of commit b396bb2 (more details on the Dr. CI page):

Expand to see more

💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@drisspg drisspg marked this pull request as draft August 26, 2022 20:51
@drisspg drisspg requested a review from cpuhrsch August 26, 2022 20:53
@drisspg drisspg marked this pull request as ready for review August 26, 2022 20:55
@drisspg drisspg added module: nestedtensor NestedTensor tag see issue #25032 release notes: nested tensor Changes that have a direct impact on nested tensors labels Aug 29, 2022
@drisspg drisspg added the topic: not user facing topic category label Aug 29, 2022
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.

Sure.
No kernel needs changing?

@drisspg
Copy link
Contributor Author

drisspg commented Aug 30, 2022

Sure. No kernel needs changing?

Yeah this is a little surprising but since all offset use cases so far have been only using the start position this essentially had no change. No kernel was using ranged based looping on the offsets. This will also potentially come in handy for triton kernels.

@drisspg
Copy link
Contributor Author

drisspg commented Aug 30, 2022

@pytorchbot merge -l

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a merge job. Check the current status here and land check progress here.
The merge job was triggered with the land checks (-l) flag. If you did not specify this flag yourself, you are likely enrolled in the land checks rollout. This means that your change will be merged once all checks on your PR and the land checks have passed (ETA 4 Hours). If you need to coordinate lands between different changes and cannot risk a land race, please add the ciflow/trunk label to your PR and wait for signal to complete, and then land your changes in proper order. Having trunk, pull, and Lint pre-run on a PR will bypass land checks and the ETA should be immediate. If this is not the intended behavior, feel free to use some of the other merge options in the wiki.
Please reach out to the PyTorch DevX Team with feedback or questions!

pytorchmergebot pushed a commit that referenced this pull request Aug 30, 2022
# Summary
- Document contiguous offset construction
- Expand offsets by 1 so that storage offsets for `ntensor[i] = offsets[i+1] - offsets[i]`

Another simple one. While looking into this issue #84082 I noticed that the kernels essentially rebuild the offsets but with the added last element. I added this and also cleaned up the code a little
Pull Request resolved: #84145
Approved by: https://github.com/albanD
facebook-github-bot pushed a commit that referenced this pull request Sep 1, 2022
Summary:
# Summary
- Document contiguous offset construction
- Expand offsets by 1 so that storage offsets for `ntensor[i] = offsets[i+1] - offsets[i]`

Another simple one. While looking into this issue #84082 I noticed that the kernels essentially rebuild the offsets but with the added last element. I added this and also cleaned up the code a little

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

Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/174c3c6859529f30a7dfa4920a9a52e1373b02a9

Reviewed By: mehtanirav

Differential Revision: D39171414

Pulled By: drisspg

fbshipit-source-id: a78eab412bcae2f3b7fce49176e822a14190b9cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed Merged module: nestedtensor NestedTensor tag see issue #25032 release notes: nested tensor Changes that have a direct impact on nested tensors topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants