Skip to content

[Backend][Common] some concept explaination #7911

Answered by slaren
airMeng asked this question in Q&A
Discussion options

You must be logged in to vote

First, a brief description of what the extras actually are and what purpose they serve:

Extras are an object associated to every tensor that backends can use to store any information that they may need in addition to the buffer and data pointers. For example, the CUDA backend uses extras in the split buffers to store the pointers of each device where the data of the tensor is being stored.

Extras are set during the call to the init_tensor function of the buffer interface, and freed, or returned to the pool, during the call to the buffer reset function. There isn't an individual call to reset for every tensor allocated in this buffer, therefore the backend must keep track of all the extras…

Replies: 3 comments 2 replies

Comment options

airMeng
Jun 13, 2024
Collaborator Author

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@lslusarczyk
Comment options

@slaren
Comment options

Answer selected by airMeng
Comment options

airMeng
Jun 13, 2024
Collaborator Author

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants