Repository navigation
fix(summary): support sparse tensor inputs in memory accounting - #418
Merged
Merged
Conversation
DangTAnh
force-pushed
the
pr/150-sparse-input-memory
branch
2 times, most recently
from
October 9, 2026 02:00
16083b9 to
17a5992
Compare
Sparse COO/CSR/CSC adjacency inputs (e.g. GCNs) crashed get_total_memory_used via untyped_storage, so no summary was produced. Sum member-tensor storage for sparse layouts instead. Fixes TylerYep#150
DangTAnh
force-pushed
the
pr/150-sparse-input-memory
branch
from
October 9, 2026 02:01
6eaccaf to
c171f37
Compare
Owner
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Models that take sparse tensors (e.g. GCN adjacency matrices) crashed
summary()withNotImplementedError: Cannot access storage of SparseTensorImpl, so no summary — including the Param # column from #150 — was produced. Sparse layouts expose no single storage, so input-memory accounting now sums the member tensors (indices + values) instead.Changes
get_tensor_memoryhelper with sparse fallback;get_total_memory_useduses it.test_sparse_inputregression test (GCN with sparse COO adj).Testing
pytest tests/torchinfo_test.py tests/exceptions_test.py tests/mapping_test.py --no-output— 94 passed.Related
Fixes #150