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

Convert tensor copies to allocate from pool #113

Merged
merged 5 commits into from
Apr 25, 2024
Merged

Conversation

robertknight
Copy link
Owner

@robertknight robertknight commented Apr 25, 2024

Add TensorBase::to_tensor_buf API that makes it possible to create a contiguous copy of a tensor/view with a pre-allocated output buffer, and use it to convert the Identity, BatchNormalization, Slice, Softmax, LogSoftmax and InstanceNormalization ops to allocate from the pool.

See #109

When using this example for profiling, it is useful to be able to suppress the
full output.
These will allow operators which need to copy inputs to handle allocation of the
cloned tensor/view's buffer.
`LayerNormalization` is an exception as it is built on lower-level operators,
not all of which have been converted to use the pool yet.
@robertknight robertknight merged commit 6a0aa11 into main Apr 25, 2024
2 checks passed
@robertknight robertknight deleted the tensor-copy-pool branch April 25, 2024 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant