{"id":20866021,"url":"https://github.com/zanussbaum/surfgrad","last_synced_at":"2025-07-26T20:33:01.709Z","repository":{"id":262897913,"uuid":"863668450","full_name":"zanussbaum/surfgrad","owner":"zanussbaum","description":"webgpu autograd library","archived":false,"fork":false,"pushed_at":"2025-05-24T01:35:03.000Z","size":628,"stargazers_count":26,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-28T10:04:37.554Z","etag":null,"topics":["autograd","inference","machine-learning","tensor","webgpu","wsgl"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zanussbaum.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2024-09-26T17:38:05.000Z","updated_at":"2025-06-21T22:18:25.000Z","dependencies_parsed_at":"2025-05-12T10:52:03.634Z","dependency_job_id":null,"html_url":"https://github.com/zanussbaum/surfgrad","commit_stats":null,"previous_names":["zanussbaum/surfgrad"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/zanussbaum/surfgrad","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanussbaum%2Fsurfgrad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanussbaum%2Fsurfgrad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanussbaum%2Fsurfgrad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanussbaum%2Fsurfgrad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zanussbaum","download_url":"https://codeload.github.com/zanussbaum/surfgrad/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanussbaum%2Fsurfgrad/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267227565,"owners_count":24056354,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["autograd","inference","machine-learning","tensor","webgpu","wsgl"],"created_at":"2024-11-18T05:56:04.607Z","updated_at":"2025-07-26T20:33:01.665Z","avatar_url":"https://github.com/zanussbaum.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# surfgrad\n\n---\n\n![surfgrad](surfgrad.png)\n\n**surfgrad** is a high-performance, WebGPU-powered AutoGrad library that enables browser-based tensor operations with GPU acceleration.\n\nKey Features:\n\n- 🚀 Blazing-fast tensor operations leveraging WebGPU\n- 🧠 Automatic differentiation for deep learning in the browser\n- 🌐 Zero backend dependencies - runs entirely client-side\n- 📦 Lightweight and easy to integrate into existing web projects\n\nPerfect for running tensor operations and (in the future) machine learning models in the browser!\n\nIt's heavily inspired by [micrograd](https://github.com/karpathy/micrograd),\n[tinygrad](https://github.com/tinygrad/tinygrad), and [PyTorch](https://github.com/pytorch/pytorch) and aims to leverage the power of WebGPU/WGSL for in-browser machine learning.\n\n## Usage\n\n---\n\n`surfgrad` supports basic tensor operations such as `matmul`, `mul`, `add`, `exp`, and `log`.\n\nTo use `surfgrad`,\n\n```typescript\nimport { Tensor } from \"surfgrad\";\n\nconst tensorA = new Tensor(new Float32Array([1, 2, 3, 4]), [2, 2], true);\nconst tensorB = new Tensor(new Float32Array([5, 6, 7, 8]), [2, 2], true);\n\nconst [result, executionTime] = await tensorA.matmul(tensorB);\n\nconsole.log(result);\n\nawait result.backward();\n\n```\n\n## Testing\n\n---\n\n`surfgrad` has unit tests and integration tests. To run the unit tests, run the following command:\n\n```bash\nnpm run unit\n```\n\nand to run the integration tests, run the following command:\n\n```bash\nnpm run integration\n```\n\n## Benchmarks\n\n---\n\nWe also have benchmarks that can be helpful to demonstrate the performance of the `matmul` kernels.\nTo run the benchmarks, run the following command:\n\n```bash\nnpm run benchmark\n```\n\nand open a browser to `localhost:9000`.\n\nThis will run the benchmarks for the library and display the results.\n\n## Contributing\n\n---\n\nContributions to `surfgrad` are welcome! If you'd like to contribute, please fork the repository and submit a pull request.\n\n## License\n\n---\n\nSurfGrad is licensed under the Apache 2.0 License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzanussbaum%2Fsurfgrad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzanussbaum%2Fsurfgrad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzanussbaum%2Fsurfgrad/lists"}