Skip to content

Conversation

@jbschlosser
Copy link
Contributor

@jbschlosser jbschlosser commented Sep 23, 2024

Stack from ghstack (oldest at bottom):

Requested in #136270

TODO:

  • I expect there will be torch.compile() problems from the use of the item() calls in the naive impl; fix these

cc @cpuhrsch @bhosmer @drisspg @soulitzer @davidberard98 @YuqingJ

@pytorch-bot
Copy link

pytorch-bot bot commented Sep 23, 2024

🔗 Helpful Links

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

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

❌ 13 New Failures

As of commit 36ba8d8 with merge base 03ec250 (image):

NEW FAILURES - The following jobs have failed:

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

jbschlosser added a commit that referenced this pull request Sep 23, 2024
ghstack-source-id: 768b2b4
Pull Request resolved: #136444
@jbschlosser jbschlosser added module: nestedtensor NestedTensor tag see issue #25032 topic: improvements topic category release notes: nested tensor Changes that have a direct impact on nested tensors labels Sep 23, 2024
@albanD albanD removed their request for review September 23, 2024 18:11
@jbschlosser
Copy link
Contributor Author

jbschlosser commented Oct 22, 2024

Update on this: I'm looking into but it's not easy to get this working graph-break-free with torch.compile. The heart of the issue is data-dependency: the output of narrow() on the batch dim depends on the actual data of the offsets. In particular, the returned NJT should have a values buffer with a packed sum(*) ragged dimension whose size depends on the offsets data.

Alternatively, we could return the same values buffer and just change the offsets data, avoiding the data-dependency for the shape of the returned values buffer. Now we have the following problems:

  1. I believe there is an implicit assumption throughout the NJT logic that offsets start with zero. Investigation is required to identify and remove areas where this assumption is made.
  2. Operations that operate on the underlying values buffer will do more computation than is needed, somewhat defeating the purpose of taking the narrow() view in the first place. For example, unary and binary pointwise operations simply redispatch on the underlying values buffer. It may be possible to implement these by composing some_custom_op_that_gets_the_shape(offsets, etc.) + the unary_op() / binary_op() itself.

@jbschlosser jbschlosser marked this pull request as draft October 29, 2024 14:58
Requested in #136270

TODO:
* I expect there will be `torch.compile()` problems from the use of the `item()` calls in the naive impl; fix these

cc cpuhrsch bhosmer drisspg soulitzer davidberard98 YuqingJ

[ghstack-poisoned]
Requested in #136270

TODO:
* I expect there will be `torch.compile()` problems from the use of the `item()` calls in the naive impl; fix these

cc cpuhrsch bhosmer drisspg soulitzer davidberard98 YuqingJ

[ghstack-poisoned]
Requested in #136270

TODO:
* I expect there will be `torch.compile()` problems from the use of the `item()` calls in the naive impl; fix these

cc cpuhrsch bhosmer drisspg soulitzer davidberard98 YuqingJ

[ghstack-poisoned]
Requested in #136270

TODO:
* I expect there will be `torch.compile()` problems from the use of the `item()` calls in the naive impl; fix these

cc cpuhrsch bhosmer drisspg soulitzer davidberard98 YuqingJ

[ghstack-poisoned]
Requested in #136270

TODO:
* I expect there will be `torch.compile()` problems from the use of the `item()` calls in the naive impl; fix these

cc cpuhrsch bhosmer drisspg soulitzer davidberard98 YuqingJ

[ghstack-poisoned]
Requested in #136270

TODO:
* I expect there will be `torch.compile()` problems from the use of the `item()` calls in the naive impl; fix these

cc cpuhrsch bhosmer drisspg soulitzer davidberard98 YuqingJ

[ghstack-poisoned]
Requested in #136270

TODO:
* I expect there will be `torch.compile()` problems from the use of the `item()` calls in the naive impl; fix these

cc cpuhrsch bhosmer drisspg soulitzer davidberard98 YuqingJ

[ghstack-poisoned]
@jbschlosser
Copy link
Contributor Author

Closing in favor of #142063

@github-actions github-actions bot deleted the gh/jbschlosser/177/head branch January 19, 2025 02:06
desai0007 pushed a commit to desai0007/test-repo-pytorch that referenced this pull request Feb 26, 2025
ghstack-source-id: f763a01
Pull Request resolved: pytorch/pytorch#136444
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: nestedtensor NestedTensor tag see issue #25032 release notes: nested tensor Changes that have a direct impact on nested tensors topic: improvements topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant