Discover and explore top open-source AI tools and projects—updated daily.
thomasahleSymbolic tensor manipulation for deep learning
Top 76.8% on SourcePulse
A Python package for symbolic tensor manipulation, Tensorgrad merges PyTorch's machine learning framework capabilities with SymPy's symbolic computation strengths. It automatically simplifies complex tensor expressions and compiles symbolic derivatives into highly optimized, fused PyTorch programs. This framework is designed for researchers and engineers seeking precise control over machine learning computations, enabling novel approaches to gradient computation and performance optimization.
How It Works
The core of Tensorgrad lies in its symbolic graph representation of tensor operations. It allows users to define tensor computations and their derivatives symbolically, which are then automatically simplified and compiled into efficient, straight-line PyTorch code. This approach bypasses traditional automatic differentiation for specific operations, leading to fused kernels that can offer significant performance gains and reduced memory overhead, particularly for complex models like Transformers.
Quick Start & Requirements
Installation is straightforward via pip: uv pip install tensorgrad. For diagram visualizations, LaTeX/TikZ and poppler-utils are required (apt-get install texlive-luatex texlive-latex-extra texlive-fonts-extra poppler-utils). macOS users encountering PyTorch compilation errors may need to use Homebrew's LLVM compiler (brew install llvm, export CXX=/opt/homebrew/opt/llvm/bin/clang++). Examples are available via a playground or notebook. Further documentation and the Tensor Cookbook can be found at https://tensorcookbook.com, with API details at https://tensorcookbook.com/docs/api.
Highlighted Details
Maintenance & Community
No specific details regarding maintainers, community channels (e.g., Discord, Slack), or roadmap were found in the provided README.
Licensing & Compatibility
The license type and compatibility notes for commercial use were not explicitly stated in the provided README.
Limitations & Caveats
A specific workaround involving LLVM is necessary for PyTorch's torch.compile feature on macOS due to missing standard library headers in the default clang++. The project's documentation references a "draft" Tensor Cookbook, suggesting it may still be under active development.
1 day ago
Inactive
fferflo
breandan
wandb
ironjr
mratsim
pytorch
microsoft
NVIDIA