{"id":23689799,"url":"https://github.com/thomasonzhou/minitorch","last_synced_at":"2026-02-02T09:47:32.512Z","repository":{"id":268960938,"uuid":"898196649","full_name":"thomasonzhou/minitorch","owner":"thomasonzhou","description":"rebuilding pytorch: from autograd to convolutions in CUDA","archived":false,"fork":false,"pushed_at":"2024-12-27T03:02:40.000Z","size":9877,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-27T04:17:30.710Z","etag":null,"topics":["cuda","numba","numpy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thomasonzhou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-04T00:48:21.000Z","updated_at":"2024-12-27T03:02:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"ad4408ff-d8b2-4a6a-8d54-fd365e994909","html_url":"https://github.com/thomasonzhou/minitorch","commit_stats":null,"previous_names":["thomasonzhou/minitorch"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomasonzhou%2Fminitorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomasonzhou%2Fminitorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomasonzhou%2Fminitorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomasonzhou%2Fminitorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thomasonzhou","download_url":"https://codeload.github.com/thomasonzhou/minitorch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239753700,"owners_count":19691159,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cuda","numba","numpy"],"created_at":"2024-12-30T01:39:45.750Z","updated_at":"2026-01-14T00:30:21.651Z","avatar_url":"https://github.com/thomasonzhou.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyTorch from Numpy and Numba\n\nThis is an reimplementation of a subset of the torch API. It supports the following:\n\n- [x] autodifferentiation / backpropagation\n- [x] tensors, views, broadcasting\n- [x] GPU / CUDA programming in Numba\n  - [x] map / zip / reduce\n  - [x] batched matrix multiplication\n- [x] 1D / 2D Convolution and Pooling\n- [x] activation functions\n  - [x] ReLU / GeLU / softmax / tanh\n- [x] optimizers\n  - [x] stochastic gradient descent\n\n# Getting Started\n\nTo install dependencies, create a virtual environment and install the required packages:\n```python\npython3 -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n```\nThis will install minitorch in editable mode.\n\nIf pip raises an error, it may be necessary to upgrade before installing dependencies:\n```python\npip install --upgrade pip\n```\n## Examples\n### Training a MNIST model\n\n```python\npython project/run_mnist_multiclass.py \n```\n### Creating a custom model\nA list of supported modules and functions are listed in examples/custom.py.\n\n# Repo Structure\n\nFiles prefixed with a leading underscore implement abstract base classes and tensor manipulation functions.\n\n| Subpackage | Description |\n|------------|-------------|\n| autograd | central difference / topological sort of computational graph |\n| backends | naive / parallel / CUDA implementations of map / zip / reduce / matrix multiply |\n| nn | modules and functions for building networks |\n| optim | optimizers for loss function minimization |\n\n# Extensions\n\n## Features\n- [ ] Saving and loading \n  - [ ] torch state dictionaries\n  - [ ] ONNX\n- [ ] Transformer module\n  - [x] tanh, GeLU\n- [ ] Embedding module\n- [ ] Expand core tensor operations\n  - [ ] arange, cat, stack, hstack\n- [ ] Adam optimizer\n- [ ] Additional loss functions\n- [ ] Einsum!\n\n## Optimizations\n- [ ] Bindings\n- [ ] CUDA Convolution\n\n## Documentation\n- [ ] CUDA usage with Google Collab\n\n# Credit\n\nBuilding this would have been impossible without the original course:\n[Minitorch by Sasha Rush](https://minitorch.github.io/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomasonzhou%2Fminitorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomasonzhou%2Fminitorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomasonzhou%2Fminitorch/lists"}