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

Write sparse input to dense output all at once #29

Open
drhagen opened this issue Nov 26, 2023 · 0 comments
Open

Write sparse input to dense output all at once #29

drhagen opened this issue Nov 26, 2023 · 0 comments

Comments

@drhagen
Copy link
Owner

drhagen commented Nov 26, 2023

Right now, if in a given iteration and the input is sparse while the output is dense, the iteration loop is dense and the loop writes each zero in between the sparse values. This is particularly inefficient when doing compute on an already assembled output. It also complicates the code having to always write to the output even when the input is sparse.

When the output is dense and the input is sparse, Tensora should preallocate the output and the iteration should be sparse. Care needs to be taken when subsequent layers are sparse. This might be less efficient when doing evaluate, but perhaps not depending on how optimized the processor is for writing blocks of zeros to memory. This preallocation only needs to be done during assembly and not during compute.

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

No branches or pull requests

1 participant