Skip to content
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

__setitem__ for tensors #13723

Open
afuller-TT opened this issue Oct 10, 2024 · 5 comments
Open

__setitem__ for tensors #13723

afuller-TT opened this issue Oct 10, 2024 · 5 comments

Comments

@afuller-TT
Copy link
Contributor

From the community:

Lack of __setitem__ for tensors. I had to emulate it and it isn't pretty.

@TT-billteng
Copy link
Contributor

TT-billteng commented Oct 11, 2024

why would this issue be this team's responsiblity?

@marty1885
Copy link
Contributor

For context, this need comes from my GGML backend where GGML's unittests tests for the ability to write back into tensors generally (as a part of supporting KV Cache). Currently the only way to do this is

  1. If it happens to be writing a row in a 3D tensor - use the KV cache update method as it's a fast path
  2. Else, slice and dice the original tensor, Concat 4 pieces from the original 1 from the updated data. To form a new tensor

Path 2 is extremely slow and ugly. It'll be much better if there's native support. It's something that's bugging me almost since day 1 so it's on my list of stuff when people asked what to improve.

@TT-billteng
Copy link
Contributor

For context, this need comes from my GGML backend where GGML's unittests tests for the ability to write back into tensors generally (as a part of supporting KV Cache). Currently the only way to do this is

  1. If it happens to be writing a row in a 3D tensor - use the KV cache update method as it's a fast path
  2. Else, slice and dice the original tensor, Concat 4 pieces from the original 1 from the updated data. To form a new tensor

Path 2 is extremely slow and ugly. It'll be much better if there's native support. It's something that's bugging me almost since day 1 so it's on my list of stuff when people asked what to improve.

By "this team" I'm referring to software infrastructure, not metal project as a whole. We should either re-assign to metal runtime or TTNN.

@afuller-TT
Copy link
Contributor Author

@TT-billteng I was just trying to record the feedback we received so it didn't get lost. And figured we could figure out the right team afterwards.

@TT-billteng
Copy link
Contributor

@ayerofieiev-tt please re-assign to the right board if necessary

@ayerofieiev-tt ayerofieiev-tt self-assigned this Nov 7, 2024
@milank94 milank94 added the feature-request External feature request label Nov 22, 2024
@ayerofieiev-tt ayerofieiev-tt added community and removed feature-request External feature request P2 community labels Jan 31, 2025
@ayerofieiev-tt ayerofieiev-tt removed their assignment Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants