docs: add sparse tensor naming and shape conventions#90
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a repository-wide documentation guide that standardizes how sparse tensor/matrix shapes, batching, layouts, and “specified entries” terminology are described across the project, and links it from the main docs and contributing guide.
Changes:
- Add a new
naming.rstguide defining shape/batching/layout terminology and recommended wording. - Link the guide into the Sphinx docs index and the contributing documentation.
- Adjust devcontainer runtime arguments (removes CPU pinning).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| docs/source/naming.rst | New comprehensive naming/shape/layout conventions guide for sparse tensors and batching. |
| docs/source/index.rst | Adds the new guide to the documentation toctree. |
| docs/source/contributing.rst | Points contributors to the naming/shape conventions guide. |
| .devcontainer/devcontainer.json | Removes --cpuset-cpus from container run arguments. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Adds a repository-wide guide for naming sparse tensors, matrix shapes, batch
dimensions, sparse and dense dimensions, layouts, and specified entries.
The guide establishes the following core convention:
(n_rows, n_cols);(batch_size, n_rows, n_cols);and should not be used to imply batching or spatial meaning.
It also documents:
and dense value dimensions;
nse,nnz, explicit zeros, and structural zeros;Motivation
Recent work exposed some ambiguity between terms such as “3D sparse tensor” and
“batched sparse matrix”. A tensor with shape
(batch_size, n_rows, n_cols)isrank 3, but the leading dimension represents a batch of matrices rather than
a third matrix or spatial dimension.
This guide makes the logical object and its shape explicit, aligns terminology
with existing conventions in the repository, and follows PyTorch sparse tensor
terminology where applicable.
Documentation changes
docs/source/naming.rst;Scope
Documentation only. This PR does not change runtime behaviour or public APIs.
devcontainer
Also changed the devcontainer.json to remove the CPU pinning that is only useful for my personal machine and would be likely to fail for anyone with less than 24 CPU cores/threads.