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

Optimize copying of non-contiguous tensors with 5+ dimensions #409

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

robertknight
Copy link
Owner

Improve code path for tensors with 5+ dimensions in TensorBase::init_from. Instead of falling back to slow iteration via TensorBase::iter, iterate over inner views of 4 dims and use the faster code path that handles this.

This was encountered while testing https://huggingface.co/briaai/RMBG-2.0.

Improve code path for tensors with 5+ dimensions in `TensorBase::init_from`.
Instead of falling back to slow iteration via `TensorBase::iter`, iterate over
inner views of 4 dims and use the faster code path that handles this.
@robertknight robertknight merged commit 26eeef0 into main Nov 15, 2024
2 checks passed
@robertknight robertknight deleted the faster-5d-plus-copy branch November 15, 2024 22:06
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