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

SparseConnection support #703

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

SparseConnection support #703

wants to merge 2 commits into from

Conversation

n-shevko
Copy link
Collaborator

No description provided.

@Hananel-Hazan
Copy link
Collaborator

@C-Earl what do you think?

@C-Earl
Copy link
Contributor

C-Earl commented Feb 7, 2025

Seems like a reasonable start. One thing that might be worth testing is running a model with a profiler and seeing how expensive update.to_sparse is to run. Not sure if it's possible to avoid having to call to_sparse during the update though.

@n-shevko
Copy link
Collaborator Author

n-shevko commented Feb 8, 2025

@C-Earl

Not sure if it's possible to avoid having to call to_sparse during the update though

Unfortunately, for now pytorch support only addition of the following types of tensors :

  1. dense + sparse = dense
  2. sparse + sparse = sparse

I decided to use #2
In case if we would use #1 we also can't avoid .to_sparse call for the result tensor (w in our case)

Seems like a reasonable start. One thing that might be worth testing is running a model with a profiler and seeing how expensive update.to_sparse is to run.

I run profiler on my desktop(I don't have nvidia). Screenshot is attached.
For example total _connection_update method took 5.2 seconds (total time).
to_sparse (4rth row), total time 0.2591 sec (5% of 5.2 seconds).
I can rerun it on googlecolab if needed.

Screenshot_2025-02-07_19-10-16

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.

3 participants