[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-tinygrad--tinygrad":3,"tool-tinygrad--tinygrad":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",159267,2,"2026-04-17T11:29:14",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":64,"owner_name":72,"owner_avatar_url":73,"owner_bio":74,"owner_company":75,"owner_location":75,"owner_email":76,"owner_twitter":75,"owner_website":77,"owner_url":78,"languages":79,"stars":119,"forks":120,"last_commit_at":121,"license":122,"difficulty_score":32,"env_os":123,"env_gpu":124,"env_ram":125,"env_deps":126,"category_tags":134,"github_topics":75,"view_count":32,"oss_zip_url":75,"oss_zip_packed_at":75,"status":17,"created_at":135,"updated_at":136,"faqs":137,"releases":167},8620,"tinygrad\u002Ftinygrad","tinygrad","You like pytorch? You like micrograd? You love tinygrad! ❤️ ","tinygrad 是一个极致轻量且功能完整的端到端深度学习框架，旨在填补 PyTorch 的易用性与 micrograd 的简洁性之间的空白。它不仅仅是一个张量库，更内置了从自动微分、中间表示（IR）编译、内核融合到即时编译（JIT）执行的全栈能力，让用户能够用熟悉的 PyTorch 风格代码进行真实的模型训练。\n\ntinygrad 主要解决了现有大型框架过于臃肿、黑盒化严重的问题。它将编译器逻辑和底层调度完全开源并简化，使开发者能清晰看到并修改从高层算子到底层硬件指令的整个过程。同时，它支持 CPU、CUDA、Metal、AMD 等多种加速器，仅需约 25 个底层操作即可适配新硬件，极大地降低了部署门槛。\n\n这款工具特别适合希望深入理解深度学习底层原理的研究人员、想要自定义硬件后端或优化算子的系统开发者，以及喜欢“黑客式”探索源码的教育者。其独特的技术亮点在于“惰性执行”机制，能自动将多个操作融合为单一内核以提升效率，同时保持了代码库的极小体积和高可读性。如果你既喜爱 PyTorch 的流畅体验，又渴望拥有对底层细节的完全掌控权，tinygrad 将是一个理想的选择。","\u003Cdiv align=\"center\">\n\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"\u002Fdocs\u002Flogo_tiny_light.svg\">\n  \u003Cimg alt=\"tiny corp logo\" src=\"\u002Fdocs\u002Flogo_tiny_dark.svg\" width=\"50%\" height=\"50%\">\n\u003C\u002Fpicture>\n\ntinygrad: For something between [PyTorch](https:\u002F\u002Fgithub.com\u002Fpytorch\u002Fpytorch) and [karpathy\u002Fmicrograd](https:\u002F\u002Fgithub.com\u002Fkarpathy\u002Fmicrograd). Maintained by [tiny corp](https:\u002F\u002Ftinygrad.org).\n\n\u003Ch3>\n\n[Homepage](https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad) | [Documentation](https:\u002F\u002Fdocs.tinygrad.org\u002F) | [Discord](https:\u002F\u002Fdiscord.gg\u002FZjZadyC7PK)\n\n\u003C\u002Fh3>\n\n[![GitHub Repo stars](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Ftinygrad\u002Ftinygrad)](https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fstargazers)\n[![Unit Tests](https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Factions\u002Fworkflows\u002Ftest.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Factions\u002Fworkflows\u002Ftest.yml)\n[![Discord](https:\u002F\u002Fimg.shields.io\u002Fdiscord\u002F1068976834382925865)](https:\u002F\u002Fdiscord.gg\u002FZjZadyC7PK)\n\n\u003C\u002Fdiv>\n\n---\n\ntinygrad is an end-to-end deep learning stack:\n\n- **Tensor library** with autograd\n- **IR and compiler** that fuse and lower kernels\n- **JIT + graph execution**\n- **nn \u002F optim \u002F datasets** for real training\n\nIt’s inspired by PyTorch (ergonomics), JAX (functional transforms and IR-based AD), and TVM (scheduling and codegen), but stays intentionally tiny and hackable.\n\n---\n\n## How tinygrad compares\n\n**PyTorch**\n\n- ✅ Similar: eager `Tensor` API, autograd, `optim`, basic datasets and layers.\n- ✅ You can write familiar training loops.\n- 🔁 Unlike PyTorch, the entire compiler and IR are visible and hackable.\n\n**JAX**\n\n- ✅ IR-based autodiff over primitives (like JAXPR + XLA).\n- ✅ Function-level JIT (`TinyJit`) that captures and replays kernels.\n- 🔁 Fewer functional transforms (no full `vmap`\u002F`pmap` yet), but far easier to read.\n\n**TVM**\n\n- ✅ Multiple lowering passes, scheduling, and BEAM search over kernels.\n- ✅ Device “graphs” for batched execution.\n- 🔁 tinygrad also ships the **front-end framework** (tensors, nn, optim), not just the compiler.\n\n---\n\n### Laziness\n\nTry a matmul. See how, despite the style, it is fused into one kernel with the power of laziness.\n\n```sh\nDEBUG=3 python3 -c \"from tinygrad import Tensor;\nN = 1024; a, b = Tensor.empty(N, N), Tensor.empty(N, N);\n(a.reshape(N, 1, N) * b.T.reshape(1, N, N)).sum(axis=2).realize()\"\n```\n\nAnd we can change `DEBUG` to `4` to see the generated code.\n\n### Neural networks\n\nAs it turns out, 90% of what you need for neural networks are a decent autograd\u002Ftensor library.\nThrow in an optimizer, a data loader, and some compute, and you have all you need.\n\n```python\nfrom tinygrad import Tensor, nn\n\nclass LinearNet:\n  def __init__(self):\n    self.l1 = Tensor.kaiming_uniform(784, 128)\n    self.l2 = Tensor.kaiming_uniform(128, 10)\n  def __call__(self, x:Tensor) -> Tensor:\n    return x.flatten(1).dot(self.l1).relu().dot(self.l2)\n\nmodel = LinearNet()\noptim = nn.optim.Adam([model.l1, model.l2], lr=0.001)\n\nx, y = Tensor.rand(4, 1, 28, 28), Tensor([2,4,3,7])  # replace with real mnist dataloader\n\nwith Tensor.train():\n  for i in range(10):\n    optim.zero_grad()\n    loss = model(x).sparse_categorical_crossentropy(y).backward()\n    optim.step()\n    print(i, loss.item())\n```\n\nSee [examples\u002Fbeautiful_mnist.py](examples\u002Fbeautiful_mnist.py) for the full version that gets 98% in ~5 seconds\n\n## Accelerators\n\ntinygrad already supports numerous accelerators, including:\n\n- [x] [OpenCL](tinygrad\u002Fruntime\u002Fops_cl.py)\n- [x] [CPU](tinygrad\u002Fruntime\u002Fops_cpu.py)\n- [x] [METAL](tinygrad\u002Fruntime\u002Fops_metal.py)\n- [x] [CUDA](tinygrad\u002Fruntime\u002Fops_cuda.py)\n- [x] [AMD](tinygrad\u002Fruntime\u002Fops_amd.py)\n- [x] [NV](tinygrad\u002Fruntime\u002Fops_nv.py)\n- [x] [QCOM](tinygrad\u002Fruntime\u002Fops_qcom.py)\n- [x] [WEBGPU](tinygrad\u002Fruntime\u002Fops_webgpu.py)\n\nAnd it is easy to add more! Your accelerator of choice only needs to support a total of ~25 low level ops.\n\nTo check default accelerator run: `python3 -c \"from tinygrad import Device; print(Device.DEFAULT)\"`\n\n## Installation\n\nThe current recommended way to install tinygrad is from source.\n\n### From source\n\n```sh\ngit clone https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad.git\ncd tinygrad\npython3 -m pip install -e .\n```\n\n### Direct (master)\n\n```sh\npython3 -m pip install git+https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad.git\n```\n\n## Documentation\n\nDocumentation along with a quick start guide can be found on the [docs website](https:\u002F\u002Fdocs.tinygrad.org\u002F) built from the [docs\u002F](\u002Fdocs) directory.\n\n### Quick example comparing to PyTorch\n\n```python\nfrom tinygrad import Tensor\n\nx = Tensor.eye(3, requires_grad=True)\ny = Tensor([[2.0,0,-2.0]], requires_grad=True)\nz = y.matmul(x).sum()\nz.backward()\n\nprint(x.grad.tolist())  # dz\u002Fdx\nprint(y.grad.tolist())  # dz\u002Fdy\n```\n\nThe same thing but in PyTorch:\n```python\nimport torch\n\nx = torch.eye(3, requires_grad=True)\ny = torch.tensor([[2.0,0,-2.0]], requires_grad=True)\nz = y.matmul(x).sum()\nz.backward()\n\nprint(x.grad.tolist())  # dz\u002Fdx\nprint(y.grad.tolist())  # dz\u002Fdy\n```\n\n## Contributing\n\nThere has been a lot of interest in tinygrad lately. Following these guidelines will help your PR get accepted.\n\nWe'll start with what will get your PR closed with a pointer to this section:\n\n- No code golf! While low line count is a guiding light of this project, anything that remotely looks like code golf will be closed. The true goal is reducing complexity and increasing readability, and deleting `\\n`s does nothing to help with that.\n- All docs and whitespace changes will be closed unless you are a well-known contributor. The people writing the docs should be those who know the codebase the absolute best. People who have not demonstrated that shouldn't be messing with docs. Whitespace changes are both useless *and* carry a risk of introducing bugs.\n- Anything you claim is a \"speedup\" must be benchmarked. In general, the goal is simplicity, so even if your PR makes things marginally faster, you have to consider the tradeoff with maintainability and readability.\n- In general, the code outside the core `tinygrad\u002F` folder is not well tested, so unless the current code there is broken, you shouldn't be changing it.\n- If your PR looks \"complex\", is a big diff, or adds lots of lines, it won't be reviewed or merged. Consider breaking it up into smaller PRs that are individually clear wins. A common pattern I see is prerequisite refactors before adding new functionality. If you can (cleanly) refactor to the point that the feature is a 3 line change, this is great, and something easy for us to review.\n\nNow, what we want:\n\n- Bug fixes (with a regression test) are great! This library isn't 1.0 yet, so if you stumble upon a bug, fix it, write a test, and submit a PR, this is valuable work.\n- Solving bounties! tinygrad [offers cash bounties](https:\u002F\u002Fdocs.google.com\u002Fspreadsheets\u002Fd\u002F1WKHbT-7KOgjEawq5h5Ic1qUWzpfAzuD_J06N1JwOCGs\u002Fedit?usp=sharing) for certain improvements to the library. All new code should be high quality and well tested.\n- Features. However, if you are adding a feature, consider the line tradeoff. If it's 3 lines, there's less of a bar of usefulness it has to meet over something that's 30 or 300 lines. All features must have regression tests. In general with no other constraints, your feature's API should match torch or numpy.\n- Refactors that are clear wins. In general, if your refactor isn't a clear win it will be closed. But some refactors are amazing! Think about readability in a deep core sense. A whitespace change or moving a few functions around is useless, but if you realize that two 100 line functions can actually use the same 110 line function with arguments while also improving readability, this is a big win. Refactors should pass [process replay](#process-replay-tests).\n- Tests\u002Ffuzzers. If you can add tests that are non brittle, they are welcome. We have some fuzzers in here too, and there's a plethora of bugs that can be found with them and by improving them. Finding bugs, even writing broken tests (that should pass) with `@unittest.expectedFailure` is great. This is how we make progress.\n- Dead code removal from core `tinygrad\u002F` folder. We don't care about the code in extra, but removing dead code from the core library is great. Less for new people to read and be confused by.\n\n### Running tests\n\nYou should install the pre-commit hooks with `pre-commit install`. This will run the linter, mypy, and a subset of the tests on every commit.\n\nFor more examples on how to run the full test suite please refer to the [CI workflow](.github\u002Fworkflows\u002Ftest.yml).\n\nSome examples of running tests locally:\n```sh\npython3 -m pip install -e '.[testing]'  # install extra deps for testing\npython3 test\u002Fbackend\u002Ftest_ops.py        # just the ops tests\npython3 -m pytest test\u002F                 # whole test suite\n```\n\n#### Process replay tests\n\n[Process replay](https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fblob\u002Fmaster\u002Ftest\u002Fexternal\u002Fprocess_replay\u002FREADME.md) compares your PR's generated kernels against master. If your PR is a refactor or speedup without any expected behavior change, It should include [pr] in the pull request title.\n","\u003Cdiv align=\"center\">\n\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"\u002Fdocs\u002Flogo_tiny_light.svg\">\n  \u003Cimg alt=\"tiny corp logo\" src=\"\u002Fdocs\u002Flogo_tiny_dark.svg\" width=\"50%\" height=\"50%\">\n\u003C\u002Fpicture>\n\ntinygrad：介于 [PyTorch](https:\u002F\u002Fgithub.com\u002Fpytorch\u002Fpytorch) 和 [karpathy\u002Fmicrograd](https:\u002F\u002Fgithub.com\u002Fkarpathy\u002Fmicrograd) 之间的一款深度学习框架。由 [tiny corp](https:\u002F\u002Ftinygrad.org) 维护。\n\n\u003Ch3>\n\n[主页](https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad) | [文档](https:\u002F\u002Fdocs.tinygrad.org\u002F) | [Discord](https:\u002F\u002Fdiscord.gg\u002FZjZadyC7PK)\n\n\u003C\u002Fh3>\n\n[![GitHub 仓库星标数](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Ftinygrad\u002Ftinygrad)](https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fstargazers)\n[![单元测试](https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Factions\u002Fworkflows\u002Ftest.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Factions\u002Fworkflows\u002Ftest.yml)\n[![Discord](https:\u002F\u002Fimg.shields.io\u002Fdiscord\u002F1068976834382925865)](https:\u002F\u002Fdiscord.gg\u002FZjZadyC7PK)\n\n\u003C\u002Fdiv>\n\n---\n\ntinygrad 是一个端到端的深度学习栈：\n\n- **张量库**，支持自动微分\n- **中间表示与编译器**，用于融合和降低计算核\n- **即时编译 + 图执行**\n- **nn \u002F optim \u002F datasets**，用于实际训练\n\n它受到 PyTorch（易用性）、JAX（函数式变换和基于 IR 的自动微分）以及 TVM（调度和代码生成）的启发，但刻意保持轻量级且易于扩展。\n\n---\n\n## tinygrad 与其他框架的对比\n\n**PyTorch**\n\n- ✅ 相似：急切模式下的 `Tensor` API、自动微分、优化器、基础数据集和层。\n- ✅ 可以编写熟悉的训练循环。\n- 🔁 不同于 PyTorch，tinygrad 的整个编译器和中间表示都是可见且可修改的。\n\n**JAX**\n\n- ✅ 基于中间表示的自动微分，使用原语（如 JAXPR + XLA）。\n- ✅ 函数级别的 JIT（`TinyJit`），能够捕获并重放计算核。\n- 🔁 功能性变换较少（尚未实现完整的 `vmap`\u002F`pmap`），但代码更易读。\n\n**TVM**\n\n- ✅ 多次降低 pass、调度以及基于 BEAM 搜索的计算核选择。\n- ✅ 设备“图”用于批处理执行。\n- 🔁 tinygrad 同时提供了前端框架（张量、神经网络、优化器），而不仅仅是编译器。\n\n---\n\n### 惰性求值\n\n尝试一个矩阵乘法。你会发现，尽管风格不同，但由于惰性求值机制，它会被融合为一个单一的计算核。\n\n```sh\nDEBUG=3 python3 -c \"from tinygrad import Tensor;\nN = 1024; a, b = Tensor.empty(N, N), Tensor.empty(N, N);\n(a.reshape(N, 1, N) * b.T.reshape(1, N, N)).sum(axis=2).realize()\"\n```\n\n将 `DEBUG` 改为 `4`，即可查看生成的代码。\n\n### 神经网络\n\n事实证明，构建神经网络所需的 90% 仅仅是良好的自动微分\u002F张量库。再加上优化器、数据加载器和足够的计算资源，你就拥有了所有必需的工具。\n\n```python\nfrom tinygrad import Tensor, nn\n\nclass LinearNet:\n  def __init__(self):\n    self.l1 = Tensor.kaiming_uniform(784, 128)\n    self.l2 = Tensor.kaiming_uniform(128, 10)\n  def __call__(self, x:Tensor) -> Tensor:\n    return x.flatten(1).dot(self.l1).relu().dot(self.l2)\n\nmodel = LinearNet()\noptim = nn.optim.Adam([model.l1, model.l2], lr=0.001)\n\nx, y = Tensor.rand(4, 1, 28, 28), Tensor([2,4,3,7])  # 替换为真实的 MNIST 数据加载器\n\nwith Tensor.train():\n  for i in range(10):\n    optim.zero_grad()\n    loss = model(x).sparse_categorical_crossentropy(y).backward()\n    optim.step()\n    print(i, loss.item())\n```\n\n完整版本请参见 [examples\u002Fbeautiful_mnist.py](examples\u002Fbeautiful_mnist.py)，该示例可在约 5 秒内达到 98% 的准确率。\n\n## 加速器支持\n\ntinygrad 已经支持多种加速器，包括：\n\n- [x] [OpenCL](tinygrad\u002Fruntime\u002Fops_cl.py)\n- [x] [CPU](tinygrad\u002Fruntime\u002Fops_cpu.py)\n- [x] [METAL](tinygrad\u002Fruntime\u002Fops_metal.py)\n- [x] [CUDA](tinygrad\u002Fruntime\u002Fops_cuda.py)\n- [x] [AMD](tinygrad\u002Fruntime\u002Fops_amd.py)\n- [x] [NV](tinygrad\u002Fruntime\u002Fops_nv.py)\n- [x] [QCOM](tinygrad\u002Fruntime\u002Fops_qcom.py)\n- [x] [WEBGPU](tinygrad\u002Fruntime\u002Fops_webgpu.py)\n\n并且很容易添加更多！你选择的加速器只需支持大约 25 个底层操作即可。\n\n要查看默认加速器，请运行：`python3 -c \"from tinygrad import Device; print(Device.DEFAULT)\"`\n\n## 安装\n\n目前推荐从源码安装 tinygrad。\n\n### 从源码安装\n\n```sh\ngit clone https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad.git\ncd tinygrad\npython3 -m pip install -e .\n```\n\n### 直接安装（master 分支）\n\n```sh\npython3 -m pip install git+https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad.git\n```\n\n## 文档\n\n详细的文档及快速入门指南可在 [docs 网站](https:\u002F\u002Fdocs.tinygrad.org\u002F) 上找到，该网站基于 [docs\u002F](\u002Fdocs) 目录构建而成。\n\n### 快速对比 PyTorch 的示例\n\n```python\nfrom tinygrad import Tensor\n\nx = Tensor.eye(3, requires_grad=True)\ny = Tensor([[2.0,0,-2.0]], requires_grad=True)\nz = y.matmul(x).sum()\nz.backward()\n\nprint(x.grad.tolist())  # dz\u002Fdx\nprint(y.grad.tolist())  # dz\u002Fdy\n```\n\n同样的代码在 PyTorch 中是这样：\n\n```python\nimport torch\n\nx = torch.eye(3, requires_grad=True)\ny = torch.tensor([[2.0,0,-2.0]], requires_grad=True)\nz = y.matmul(x).sum()\nz.backward()\n\nprint(x.grad.tolist())  # dz\u002Fdx\nprint(y.grad.tolist())  # dz\u002Fdy\n```\n\n## 贡献指南\n\n近来，tinygrad 引起了广泛关注。遵循以下指南将有助于您的 PR 被接受。\n\n首先，我们列出一些会导致 PR 直接关闭并指向本节的情况：\n\n- 请勿进行代码极简化！虽然低行数是本项目的指导原则之一，但任何看起来像代码极简化的提交都会被直接关闭。我们的真正目标是降低复杂度、提高可读性，而单纯删除换行符并不能达到这一目的。\n- 所有文档和空格变更的 PR 都会被关闭，除非您是广为人知的贡献者。编写文档的人应当是对代码库最为熟悉的开发者。未展现出相关能力的人员不应随意修改文档。此外，空格变更既无实际意义，还可能引入 bug。\n- 您声称的“性能提升”必须经过基准测试验证。总体而言，本项目追求简洁性，因此即使您的 PR 使代码运行速度略有提升，也需权衡维护性和可读性的影响。\n- 通常情况下，`tinygrad\u002F` 核心目录之外的代码未经充分测试，因此除非现有代码存在明显问题，否则不建议对其进行修改。\n- 如果您的 PR 看起来过于复杂、改动量过大或新增了大量代码行，则不会被评审或合并。建议将其拆分为多个更小、更清晰的 PR。常见模式是在添加新功能之前先进行必要的重构。如果能够通过（干净地）重构，使新功能仅需三行代码即可实现，这将是理想的方案，也便于我们快速评审。\n\n接下来，我们欢迎以下类型的贡献：\n\n- Bug 修复（附带回归测试）非常受欢迎！目前该库尚未发布 1.0 版本，如果您发现了 bug，请修复它、编写相应的测试用例，并提交 PR，这将是非常有价值的贡献。\n- 解决悬赏任务！tinygrad 为某些库的改进提供了现金悬赏（详见 [Google 表格](https:\u002F\u002Fdocs.google.com\u002Fspreadsheets\u002Fd\u002F1WKHbT-7KOgjEawq5h5Ic1qUWzpfAzuD_J06N1JwOCGs\u002Fedit?usp=sharing)）。所有新增代码都应具备高质量并经过充分测试。\n- 新功能。不过，在添加新功能时，请考虑代码行数与实用性之间的平衡。如果是三行代码的功能，其满足实用性的门槛自然低于三十或三百行的功能。所有新功能都必须包含回归测试。在没有其他约束的情况下，新功能的 API 应尽量与 PyTorch 或 NumPy 保持一致。\n- 明显有益的重构。一般来说，若您的重构无法带来明确的优势，PR 将被关闭。然而，有些重构确实非常出色！请从深层次上考虑代码的可读性。仅仅调整空格或简单移动几个函数并无意义，但如果发现两个各有一百行的函数实际上可以使用同一个一百一十行的函数，并通过传递参数来实现，同时还能显著提升可读性，那么这就是一次巨大的改进。此类重构应通过 [进程回放测试](#process-replay-tests)。\n- 测试用例和模糊测试工具。如果您能添加不易出错的测试用例，我们将非常欢迎。我们目前也有一些模糊测试工具，借助它们以及进一步优化这些工具，仍有许多潜在的 bug 可以被发现。即使只是编写一些本应失败但预期会通过的测试用例（使用 `@unittest.expectedFailure`），也是非常有价值的。正是通过这种方式，我们才能不断取得进展。\n- 移除核心 `tinygrad\u002F` 目录中的死代码。我们并不关心额外模块中的代码，但从核心库中移除死代码是非常有益的，这样新加入的开发者就不必阅读和困惑于这些无用的代码了。\n\n### 运行测试\n\n请使用 `pre-commit install` 安装预提交钩子。这将在每次提交时自动运行 linter、mypy 以及部分测试。\n\n如需更多关于如何运行完整测试套件的示例，请参阅 [CI 工作流](.github\u002Fworkflows\u002Ftest.yml)。\n\n以下是一些本地运行测试的示例：\n```sh\npython3 -m pip install -e '.[testing]'  # 安装测试所需的额外依赖\npython3 test\u002Fbackend\u002Ftest_ops.py        # 仅运行算子测试\npython3 -m pytest test\u002F                 # 运行整个测试套件\n```\n\n#### 进程回放测试\n\n[进程回放](https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fblob\u002Fmaster\u002Ftest\u002Fexternal\u002Fprocess_replay\u002FREADME.md) 会将您 PR 生成的内核与主分支的内核进行对比。如果您的 PR 是一次重构或性能优化，且未涉及行为上的变化，则应在 PR 标题中注明 `[pr]`。","# tinygrad 快速上手指南\n\ntinygrad 是一个端到端的深度学习栈，定位介于 PyTorch 和 micrograd 之间。它拥有自动微分张量库、融合内核的编译器、JIT 执行以及完整的神经网络训练组件，同时保持代码极简且易于黑客式修改。\n\n## 环境准备\n\n*   **操作系统**：Linux, macOS, Windows (WSL 推荐)\n*   **Python 版本**：Python 3.8 或更高版本\n*   **前置依赖**：\n    *   `git`：用于克隆源码\n    *   `pip`：Python 包管理工具\n    *   (可选) 特定硬件驱动：如需使用 GPU 加速，请确保已安装对应的 CUDA、ROCm、Metal 或 OpenCL 驱动。\n\n## 安装步骤\n\n推荐从源码安装以获取最新功能，同时也支持直接通过 pip 安装主分支版本。\n\n### 方式一：从源码安装（推荐）\n\n```sh\ngit clone https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad.git\ncd tinygrad\npython3 -m pip install -e .\n```\n\n### 方式二：直接安装（Master 分支）\n\n```sh\npython3 -m pip install git+https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad.git\n```\n\n> **提示**：国内用户若遇到克隆或下载速度慢的问题，可配置 Git 和 Pip 的国内镜像源（如清华源、阿里源）进行加速。\n\n### 验证默认加速器\n\n安装完成后，可运行以下命令查看当前默认使用的计算设备：\n\n```sh\npython3 -c \"from tinygrad import Device; print(Device.DEFAULT)\"\n```\n\n## 基本使用\n\ntinygrad 的 API 设计与 PyTorch 高度相似，支持动态图执行和自动微分。\n\n### 1. 简单的自动微分示例\n\n以下示例演示了如何创建张量、执行矩阵乘法、求和并进行反向传播：\n\n```python\nfrom tinygrad import Tensor\n\nx = Tensor.eye(3, requires_grad=True)\ny = Tensor([[2.0,0,-2.0]], requires_grad=True)\nz = y.matmul(x).sum()\nz.backward()\n\nprint(x.grad.tolist())  # dz\u002Fdx\nprint(y.grad.tolist())  # dz\u002Fdy\n```\n\n### 2. 构建并训练一个简单的神经网络\n\ntinygrad 内置了 `nn` 模块，包含优化器、层定义等工具。以下是一个简单的线性网络训练循环：\n\n```python\nfrom tinygrad import Tensor, nn\n\nclass LinearNet:\n  def __init__(self):\n    self.l1 = Tensor.kaiming_uniform(784, 128)\n    self.l2 = Tensor.kaiming_uniform(128, 10)\n  def __call__(self, x:Tensor) -> Tensor:\n    return x.flatten(1).dot(self.l1).relu().dot(self.l2)\n\nmodel = LinearNet()\noptim = nn.optim.Adam([model.l1, model.l2], lr=0.001)\n\n# 模拟输入数据 (batch_size=4)\nx, y = Tensor.rand(4, 1, 28, 28), Tensor([2,4,3,7])\n\nwith Tensor.train():\n  for i in range(10):\n    optim.zero_grad()\n    loss = model(x).sparse_categorical_crossentropy(y).backward()\n    optim.step()\n    print(i, loss.item())\n```\n\n### 3. 体验惰性计算 (Laziness)\n\ntinygrad 默认采用惰性执行策略，操作会被融合为单个内核。可以通过设置 `DEBUG` 环境变量观察生成的代码：\n\n```sh\n# 查看执行过程\nDEBUG=3 python3 -c \"from tinygrad import Tensor; N = 1024; a, b = Tensor.empty(N, N), Tensor.empty(N, N); (a.reshape(N, 1, N) * b.T.reshape(1, N, N)).sum(axis=2).realize()\"\n\n# 查看生成的底层代码\nDEBUG=4 python3 -c \"from tinygrad import Tensor; N = 1024; a, b = Tensor.empty(N, N), Tensor.empty(N, N); (a.reshape(N, 1, N) * b.T.reshape(1, N, N)).sum(axis=2).realize()\"\n```","一位嵌入式 AI 工程师需要在资源受限的树莓派或老旧笔记本上快速验证新的神经网络架构原型，同时希望深入理解底层算子融合机制以优化推理延迟。\n\n### 没有 tinygrad 时\n- **环境部署沉重**：安装 PyTorch 或 TensorFlow 往往需要数 GB 的依赖库和特定的 CUDA 版本，在边缘设备上极易因内存不足而失败。\n- **黑盒调试困难**：当模型性能不佳时，开发者无法查看中间编译过程，难以判断是算子未融合还是调度策略问题，只能盲目调整参数。\n- **硬件适配门槛高**：若想尝试在非主流加速器（如特定 AMD GPU 或 WebGPU）上运行，通常需要编写复杂的底层 C++\u002FCUDA 代码或等待官方支持。\n- **学习曲线陡峭**：想要从零实现一个自定义算子或修改反向传播逻辑，面对庞大的框架源码往往无从下手，修改成本极高。\n\n### 使用 tinygrad 后\n- **轻量级即时运行**：tinygrad 仅需极少的依赖即可安装，直接在树莓派等低配设备上加载并运行完整的训练循环，启动秒级完成。\n- **透明化内核洞察**：通过设置 `DEBUG` 环境变量，开发者能直接看到生成的底层代码和算子融合细节，精准定位性能瓶颈并进行针对性优化。\n- **跨平台无缝切换**：只需更改一行代码指定设备（如 `METAL` 或 `OPENCL`），同一套模型代码即可在不同硬件后端高效运行，无需重写算子。\n- **极高的可黑客性**：框架核心代码仅数千行，开发者可以轻松阅读甚至修改其 IR 编译器与调度器，快速实现个性化的算子逻辑或教学演示。\n\ntinygrad 让深度学习框架从“不可触碰的黑盒”变成了“透明且可随意拆解的乐高”，极大降低了边缘侧模型研发与底层原理探索的门槛。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftinygrad_tinygrad_7ff6e313.png","the tiny corp","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Ftinygrad_8908ca58.png","We will commoditize the petaflop.",null,"george@tinygrad.org","https:\u002F\u002Ftinygrad.org\u002F","https:\u002F\u002Fgithub.com\u002Ftinygrad",[80,84,88,92,96,100,104,108,112,115],{"name":81,"color":82,"percentage":83},"Python","#3572A5",67.1,{"name":85,"color":86,"percentage":87},"C","#555555",23.2,{"name":89,"color":90,"percentage":91},"Cuda","#3A4E3A",5.4,{"name":93,"color":94,"percentage":95},"C++","#f34b7d",1.9,{"name":97,"color":98,"percentage":99},"Metal","#8f14e9",1.6,{"name":101,"color":102,"percentage":103},"Assembly","#6E4C13",0.4,{"name":105,"color":106,"percentage":107},"JavaScript","#f1e05a",0.2,{"name":109,"color":110,"percentage":111},"HTML","#e34c26",0.1,{"name":113,"color":114,"percentage":111},"Shell","#89e051",{"name":116,"color":117,"percentage":118},"Swift","#F05138",0,32464,4076,"2026-04-17T12:16:15","MIT","Linux, macOS","非必需。支持多种加速器：NVIDIA GPU (CUDA), AMD GPU, Apple Silicon (Metal), Intel\u002FAMD CPU (OpenCL), WebGPU, Qualcomm (QCOM)。具体显存和 CUDA 版本未说明，取决于所选后端。","未说明",{"notes":127,"python":128,"dependencies":129},"该工具主打轻量级和可黑盒化，核心代码极少。推荐从源码安装。支持约 25 种底层操作即可适配新加速器。不同硬件后端需安装对应的运行时驱动（如 NVIDIA 驱动、AMD ROCm、Apple Metal 等）。测试需安装额外依赖包 (.[testing])。","3.8+",[130,131,132,133],"numpy (隐式依赖)","pyopencl (可选，用于 OpenCL)","pycuda (可选，用于 CUDA)","llvmlite (可能用于编译)",[14],"2026-03-27T02:49:30.150509","2026-04-18T02:22:12.120886",[138,143,148,153,158,163],{"id":139,"question_zh":140,"answer_zh":141,"source_url":142},38604,"在 M1\u002FM2 Mac 上运行 tinygrad 时遇到 Metal 错误 \"MTLLibrary is not formatted as a MetalLib file\" 怎么办？","该问题通常是由于 conda 环境中的 Python 二进制文件使用了旧版本的 libSystem，而 tinygrad 使用了私有的 Metal API 导致的。这并非 Metal 本身的 bug。建议尝试以下方案：\n1. 避免在使用 conda 创建的旧环境中运行，尝试使用系统自带的 Python 或更新 conda 环境。\n2. 该问题在新版 Metal 后端中可能已得到解决（参考 PR #6545），请确保升级到最新版本的 tinygrad。\n3. 如果问题依旧，由于涉及私有 API 和系统库版本冲突，可能无法通过简单配置修复，需等待官方进一步适配。","https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fissues\u002F2226",{"id":144,"question_zh":145,"answer_zh":146,"source_url":147},38605,"为什么在 GPU 上运行 EfficientNet 训练脚本非常慢且显存占用高？","主要原因包括内存管理不当和内核执行效率低。具体优化建议如下：\n1. **手动释放内存**：在每次训练迭代结束时，使用 `del` 语句显式删除不再需要的张量（如 `del loss`, `del inputs`），防止计算图保留引用导致显存泄漏。\n2. **内核融合（Kernel Fusion）**：tinygrad 的性能瓶颈常在于多次内核调用（如 Mul, Add 等元素级操作）。内核融合可以将多个操作合并为一个内核执行，减少全局内存访问开销。\n3. **检查算子实现**：早期版本中某些算子（如 batchnorm）可能未完全优化，尝试冻结这些层或使用更新的代码版本（参考 litenn ops 的改进）。","https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fissues\u002F104",{"id":149,"question_zh":150,"answer_zh":151,"source_url":152},38606,"如何分析并优化 tinygrad 中 GPU 推理速度慢的问题？","可以通过以下步骤进行性能分析和优化：\n1. **启用调试模式**：设置环境变量 `DEBUG=1` 运行脚本，这将输出详细的性能剖析信息，显示每个操作（如 Conv2D, Mul, Add）的具体耗时。\n2. **识别瓶颈**：分析日志发现，耗时最高的往往不是卷积（Conv2D），而是大量的元素级操作（如 Mul, Add, Pow）和内存重塑（Reshape）。\n3. **优化策略**：\n   - **内存合并访问**：确保全局 GPU 内存的读写是合并的（Coalesced），避免碎片化访问。\n   - **内核融合**：将连续的元素级操作融合为单个内核，减少启动开销和内存带宽压力。","https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fissues\u002F101",{"id":154,"question_zh":155,"answer_zh":156,"source_url":157},38607,"在使用 HSA 后端运行时出现段错误（Segmentation Fault）如何解决？","该问题出现在特定的 AMD GPU 配置中（如 7900 XTX + Threadripper）。目前的解决方案如下：\n1. **后端变更**：tinygrad 已经移除了 `HSA` 后端，改用新的 `AMD` 后端。请升级 tinygrad 到最新版本，并将设备设置改为 `AMD`。\n2. **已知状态**：原 HSA 后端的段错误可能与 `_ctypes` 模块中的指针处理有关。如果在新版 `AMD` 后端中仍遇到类似问题，请重新提交 Issue 并提供新的堆栈跟踪信息。","https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fissues\u002F4217",{"id":159,"question_zh":160,"answer_zh":161,"source_url":162},38608,"Metal CI 测试失败（如 test_half_to_int8）是否正常？如何处理？","部分 Metal CI 测试失败是已知现象，处理方式如下：\n1. **测试移除**：某些特定测试（如 `test_half_to_int8`）已在后续版本（PR #1306）中被移除，因为它们不再适用于当前的实现逻辑。\n2. **环境同步**：目前 Metal CI 的行为已与本地运行环境基本一致。如果本地运行正常，可以忽略 CI 中的特定跳过项。\n3. **数据类型问题**：涉及 dtype 转换的复杂逻辑正在通过独立的 PR 逐步解决，建议关注相关更新或单独提交具体的 dtype 问题。","https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fissues\u002F1019",{"id":164,"question_zh":165,"answer_zh":166,"source_url":147},38609,"如何在 Kaggle 等资源受限的环境中运行 tinygrad？有什么性能预期？","在 Kaggle (如 Tesla P100) 上运行 tinygrad 是可行的，但需注意以下性能和配置差异：\n1. **显存限制**：相比 PyTorch，tinygrad 可能需要更多显存。例如在 EfficientNet 训练中，PyTorch 可支持 Batch Size 128，而 tinygrad 可能仅支持 BS=16。\n2. **速度差异**：早期版本在反向传播（特别是 conv2d）上可能比 PyTorch 慢两个数量级（例如 7 小时 vs 4 分钟\u002Fepoch）。\n3. **优化建议**：\n   - 暂时冻结未完全实现的层（如 batchnorm）。\n   - 尽量使用最新的 tinygrad 版本以获得性能改进。\n   - 接受在资源受限环境下较小的 Batch Size 和较长的训练时间。",[168,173,178,183,188,193,198,203,208,213,218,223,228,233],{"id":169,"version":170,"summary_zh":171,"released_at":172},314505,"v0.12.0","新年与 CES 展后发布  \n自 `0.11.0` 版本以来，已有超过 1800 次提交。代码量达到 19075 行。\n\n## 发布亮点\n\n- rangeify [[PRs](https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fpulls?q=sort%3Aupdated-desc+is%3Apr+is%3Amerged+rangeify)]\n- 大量 `VIZ=1` 相关改动\n\t- 在可视化工具中支持 AMD SQTT 和 PMC\n\t- AMD 波次可视化\n\t- 基于块的反汇编查看器\n- NIR \u002F NAK 支持\n- AM 中对 MI300 \u002F MI350 的支持\n\n### 查看完整变更日志：https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fcompare\u002Fv0.11.0...v0.12.0\n\n### 欢迎加入 [Discord](https:\u002F\u002Fdiscord.gg\u002FbeYbxwxVdx)！","2026-01-12T17:04:41",{"id":174,"version":175,"summary_zh":176,"released_at":177},314506,"v0.11.0","ONNX 支持、无需内核的 NV 运行时，以及更多！\n自 `0.10.3` 以来，已有超过 1000 次提交。\n代码量达到 16671 行。\n\n## 发布亮点\n\n- [ONNX 支持](https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fblob\u002Fmaster\u002Ftinygrad\u002Ffrontend\u002Fonnx.py) 已合并到主分支，现在无需从额外模块导入即可使用 ONNX [#11675] [[PR 列表](https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fpulls?q=sort%3Aupdated-desc+is%3Apr+is%3Amerged+onnx+)]\n- 大量运行时改动\n  - `AMD` 运行时支持 MI350 [#11148]\n  - NV 支持 Blackwell [#10487]\n  - NV 用户态驱动 [#10521]\n- 通过 IB 实现多主机支持 [#9746]\n- Muon 优化器 [#11414]\n- `VIZ=1` 相关的大量改动 [[PR 列表](https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fpulls?q=sort%3Aupdated-desc+is%3Apr+is%3Amerged+viz)]\n  - 内置性能分析器 [#10763]\n  - 内存可视化工具 [#10960]\n\n### 完整变更日志请见：https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fcompare\u002Fv0.10.3...v0.11.0\n\n### 欢迎加入 [Discord](https:\u002F\u002Fdiscord.gg\u002FbeYbxwxVdx)！","2025-08-19T21:11:27",{"id":179,"version":180,"summary_zh":181,"released_at":182},314507,"v0.10.3","大量的运行时改动。\n自 `0.10.2` 以来，已有超过 800 次提交。\n代码量达到 12,990 行。\n\n## 发布亮点\n\n- 支持通过 USB3 连接到 ASM2464PD 控制器的 RDNA3\u002FRDNA4 GPU [#8766] [[PRs](https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fpulls?q=sort%3Aupdated-desc+is%3Apr+usbgpu+is%3Amerged)]\n- 更多 `AMD`\u002F`AM` 运行时改进\n\t- MI300X 支持 [#9585]\n\t- RDNA 3.5 支持 [#9627]\n\t- RDNA 4 支持 [#9455]\n- 设置 `AMD_LLVM=1` 后不再需要 `comgr`，直接使用 LLVM [#9543] [[PRs](https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fpulls?q=sort%3Aupdated-desc+is%3Apr+is%3Amerged+AMD_LLVM+)]\n- PyTorch 前端支持 [#9191] [[PRs](https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fpulls?page=1&q=sort%3Aupdated-desc+is%3Apr+torch+backend+is%3Amerged)]\n- `CLOUD` 已更名为 `REMOTE`，并带来了性能提升 [#10166] [#9876] [#10235] [[PRs](https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fpulls?q=sort%3Aupdated-desc+is%3Apr+is%3Amerged+remote+)]\n\n### 完整变更日志请见：https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fcompare\u002Fv0.10.2...v0.10.3\n\n### 欢迎加入 [Discord](https:\u002F\u002Fdiscord.gg\u002FbeYbxwxVdx)！","2025-05-14T22:45:47",{"id":184,"version":185,"summary_zh":186,"released_at":187},314508,"v0.10.2","小幅修复。\n共 11263 行。\n\n## 发布亮点\n\n- CLANG 已更名为 CPU\n- VIZ 现已在发布版本中正常工作\n- 重写器的重构\n- 内核 UOp\n- 将 WebGPU 切换至 Dawn 后端，与 Chrome 保持一致 [#8646]\n\n### 查看完整变更日志：https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fcompare\u002Fv0.10.1...v0.10.2\n\n### 加入 [Discord](https:\u002F\u002Fdiscord.gg\u002FbeYbxwxVdx)！","2025-02-21T03:09:38",{"id":189,"version":190,"summary_zh":191,"released_at":192},314509,"v0.10.1","LazyBuffers 已经消失了！  \n代码行数为 10941 行。\n\n## 发布亮点\n\n- 取消 LazyBuffer，仅使用不可变的 UOp + Tensor\n- 使用 graph_rewrite 实现新的 multi 和梯度计算\n- 多项调度器升级，请尝试设置 VIZ=1\n- 提供 AM 驱动，实现完全无需 AMD 的体验！\n- llvmlite 不再是依赖项\n- DSP 模拟器\n\n### 查看完整变更日志：https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fcompare\u002Fv0.10.0...v0.10.1\n\n### 加入 [Discord](https:\u002F\u002Fdiscord.gg\u002FbeYbxwxVdx)！","2025-02-05T03:26:55",{"id":194,"version":195,"summary_zh":196,"released_at":197},314510,"v0.10.0","一次重大的底层更新。\n自 `0.9.2` 以来，共有超过 1200 次提交。\n代码量达到 9937 行。\n\n## 发布亮点\n\n- 使用 `VIZ=1` 可以查看重写过程，不妨试试。\n- 完全无 Python 依赖！\n  - 从 NumPy 的随机数生成器切换到 Threefry，移除了 NumPy 依赖 [#6116]。\n  - 将 Metal 后端的实现从 PyObjC 切换为 ctypes，移除了 PyObjC 依赖 [#6545]。\n- 新增 3 个后端：\n  - `QCOM=1`：针对 Adreno 630 GPU 的 HCQ 后端，可提升运行时速度 [#5213]。\n  - `CLOUD=1`：用于远程 Tinygrad 的云端后端 [#6964]。\n  - `DSP=1`：高通设备上的 DSP 后端（Alpha 阶段）[#6112]。\n- 更多张量核心支持：\n  - 苹果 AMX 支持 [#5693]。\n  - Intel XMX 张量核心支持 [#5622]。\n- 核心重构：\n  - 移除符号计算，现仅使用 UOp 重写。\n  - 大量基于 EXPAND、VECTORIZE 和 INDEX 的重构。\n  - 正在推进用 UOp 替代 LazyBuffer 的工作。\n\n### 查看完整变更日志：https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fcompare\u002Fv0.9.2...v0.10.0\n\n### 查看已知问题：https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fissues?q=is%3Aissue+is%3Aopen+label%3Abug+sort%3Aupdated-desc\n\n### 欢迎加入 [Discord](https:\u002F\u002Fdiscord.gg\u002FbeYbxwxVdx)！","2024-11-19T00:48:26",{"id":199,"version":200,"summary_zh":201,"released_at":202},314511,"v0.9.2","小幅改动。\n自 `0.9.1` 以来，已有超过 700 次提交。\n\n## 发布亮点\n\n- 当 `BEAM>=100` 时启用实验性的 [蒙特卡洛树搜索](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMonte_Carlo_tree_search) [#5598]\n- 设置 `TRANSCENDENTAL>=2`，或在 `CLANG` 和 `LLVM` 上默认启用，以提供 `sin`、`log2` 和 `exp2` 的近似实现。[#5187]\n- 使用 `DEBUG>=2` 运行时，现在会显示构成某个内核的张量操作 [#5271]\n![image](https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F0c583295-d66d-4475-a86d-310a9a246aa3)\n- 在使用 HCQ 后端（`AMD`、`NV`）时，新增 `PROFILE=1` 性能分析器功能\n![image](https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fa7b07962-31b7-4154-9ba1-3b0320b1e1e5)\n- 将 `Linearizer` 重构为 `Lowerer` [#4957]\n\n### 查看完整变更日志：https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fcompare\u002Fv0.9.1...v0.9.2\n\n### 查看已知问题：https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fissues?q=is%3Aissue+is%3Aopen+label%3Abug+sort%3Aupdated-desc\n\n### 加入 [Discord](https:\u002F\u002Fdiscord.gg\u002FbeYbxwxVdx)！","2024-08-13T23:19:48",{"id":204,"version":205,"summary_zh":206,"released_at":207},314512,"v0.9.1","目前代码行数为7844行，少于上一个版本。\n计划更频繁地打标签发布新版本。\n\n自 `0.9.0` 以来，已有超过320次提交。\n\n## 发布亮点\n\n- 移除 HSA 后端，默认使用 AMD 后端。[#4885]\n- [tinychat](https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Ftree\u002Fmaster\u002Fexamples\u002Ftinychat)，一个非常简单的 LLM Web UI。[#4869]\n- [SDXL 示例](https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fblob\u002Fmaster\u002Fexamples\u002Fsdxl.py)。[#5206]\n- 一个小型的 tqdm 替代实现。[#4846]\n- 使用 [perfetto](https:\u002F\u002Fui.perfetto.dev\u002F) 的 NV\u002FAMD 性能分析器。[#4718]\n\n## 已知问题\n\n- 在 macOS 上的 Conda 环境中使用 tinygrad，已知会导致 `METAL` 后端出现问题。详情请参阅 #2226。\n\n### 查看完整变更日志：https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fcompare\u002Fv0.9.0...v0.9.1\n\n### 查看已知问题：https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fissues?q=is%3Aissue+is%3Aopen+label%3Abug+sort%3Aupdated-desc\n\n### 欢迎加入 [Discord](https:\u002F\u002Fdiscord.gg\u002FbeYbxwxVdx)！","2024-06-29T03:16:40",{"id":209,"version":210,"summary_zh":211,"released_at":212},314513,"v0.9.0","接近新的行数上限8000行，目前为7958行。  \ntinygrad 现在已经***大大***更易用了。\n\n自 `0.8.0` 以来，总共提交了1200多次。\n\n## 发布亮点\n\n- 新文档：[https:\u002F\u002Fdocs.tinygrad.org](https:\u002F\u002Fdocs.tinygrad.org)\n- `gpuctypes` 已被纳入项目树中，不再作为外部依赖。[#3253]\n- 增加了 `AMD=1` 和 `NV=1` 实验性后端，无需任何用户态运行时组件，如 ROCm 或 CUDA。\n\t- 这些后端应能减少 Python 层面的开销，尤其是在多 GPU 场景下。\n- `PTX=1` 用于直接生成 PTX 代码，而非 CUDA 代码。[#3139] [#3623] [#3775]\n- 支持 Nvidia Tensor Core。[#3544]\n- `THREEFRY=1` 使用 threefry2x32 实现无 NumPy 的随机数生成。[#2601] [#3785]\n- [multi-tensor API](\u002Ftinygrad\u002Fmulti.py) 更加稳定。\n\t- 包括环形 All-Reduce：[#3000] [#3852]\n- tinygrad 核心已被重构为四个部分，更多信息请参阅 [这里](https:\u002F\u002Fdocs.tinygrad.org\u002Fdeveloper\u002F)。\n- Linearizer 和代码生成器现在支持生成具有多个输出的内核。\n- 调度器在更大程度上实现内核融合方面取得了显著进展。\n\t- ReduceOps 可与其元素级子节点融合。这使得训练 MNIST 和 GPT-2 时内核数量减少了约 20%，并加快了 Llama 推理速度。\n\t- 新的 LoadOps.ASSIGN 允许将优化器更新与梯度融合。\n\t- 按照 BFS 顺序调度内核，从而提升 ResNet 和 Llama 的性能。\n\t- 多个 Reduce 操作的融合仍在进行中：[#4259] [#4208]\n- MLPerf 中的 [ResNet](https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fblob\u002F0b58203cbe9ac67de3ae598c8e6552c2935fcb1e\u002Fexamples\u002Fmlperf\u002Fmodel_train.py#L14) 和 [BERT](https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fblob\u002F0b58203cbe9ac67de3ae598c8e6552c2935fcb1e\u002Fexamples\u002Fmlperf\u002Fmodel_train.py#L392)，以及正在进行中的 [UNet3D](https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fpull\u002F3470)。\n- Llama 3 支持，新增了一个 [`llama3.py`](\u002Fexamples\u002Fllama3.py)，提供了与 OpenAI 兼容的 API。[#4576]\n- Llama 示例中增加了 [NF4](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2305.14314) 量化支持。[#4540]\n- 在 `sparse_categorical_crossentropy` 中添加了 `label_smoothing`。[#3568]\n\n## 已知问题\n\n- 在 macOS 上的 Conda 环境中使用 tinygrad，已知会导致 `METAL` 后端出现问题。详情请参阅 #2226。\n\n### 查看完整变更日志：https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fcompare\u002Fv0.8.0...v0.9.0\n\n### 查看已知问题：https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fissues?q=is%3Aissue+is%3Aopen+label%3Abug+sort%3Aupdated-desc\n\n### 加入我们的 [Discord](https:\u002F\u002Fdiscord.gg\u002FbeYbxwxVdx)！","2024-05-28T18:48:47",{"id":214,"version":215,"summary_zh":216,"released_at":217},314514,"v0.8.0","接近新的5000行限制，目前为4981行。\n\n## 发布亮点\n\n- 内核中正式支持数据类型！\n- 新的 `.schedule()` API 用于分离调度与执行的关注点\n- 新的 lazy.py 实现不会在构建时重新排序。可使用 `GRAPH=1` 来调试问题\n- 在 7900XTX 上完成 95 TFLOP 的 FP16 到 FP32 矩阵乘法\n- GPT2 在 NVIDIA 3090 上以 2 毫秒（已编译）运行\n- 使用 `BEAM=2` 进行强大且快速的内核束搜索\n- GPU\u002FCUDA\u002FHIP 后端已切换至 `gpuctypes`\n- 新的（alpha 版）多 GPU 分片 API，通过 `.shard` 实现\n\n### 查看完整变更日志：https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fcompare\u002Fv0.7.0...v0.8.0\n\n### 加入 [Discord](https:\u002F\u002Fdiscord.gg\u002FbeYbxwxVdx)！","2024-01-09T18:16:07",{"id":219,"version":220,"summary_zh":221,"released_at":222},314515,"v0.7.0","Bigger again at 4311 lines :( But, tons of new features this time!\r\n\r\nJust over 500 commits since `0.6.0`.\r\n\r\n## Release Highlights\r\n\r\n- Windows support has been dropped to focus on Linux and Mac OS.\r\n\t- Some functionality may work on Windows but no support will be provided, use WSL instead.\r\n- [DiskTensors](\u002Ftinygrad\u002Fruntime\u002Fops_disk.py): a way to store tensors on disk has been added.\r\n\t- This is coupled with functionality in [`state.py`](\u002Ftinygrad\u002Fnn\u002Fstate.py) which supports saving\u002Floading safetensors and loading torch weights.\r\n- Tensor Cores are supported on M1\u002FApple Silicon and on the 7900 XTX (WMMA).\r\n\t- Support on the 7900 XTX requires weights and data to be in float16, full float16 compute support will come in a later release.\r\n\t- Tensor Core behaviour\u002Fusage is controlled by the `TC` envvar.\r\n- Kernel optimization with nevergrad\r\n\t- This optimizes the shapes going into the kernel, gated by the `KOPT` envvar.\r\n- P2P buffer transfers are supported on *most* AMD GPUs when using a single python process.\r\n\t- This is controlled by the `P2P` envvar.\r\n- LLaMA 2 support.\r\n\t- A requirement of this is bfloat16 support for loading the weights, which is semi-supported by casting them to float16, proper bfloat16 support is tracked at #1290.\r\n\t- The LLaMA example now also supports 8-bit quantization using the flag `--quantize`.\r\n- Most MLPerf models have working inference examples. Training these models is currently being worked on.\r\n- Initial multigpu training support.\r\n\t- *slow* multigpu training by copying through host shared memory.\r\n\t- Somewhat follows torch's multiprocessing and DistributedDataParallel high-level design.\r\n\t- See the [hlb_cifar10.py](\u002Fexamples\u002Fhlb_cifar10.py) example.\r\n- SymbolicShapeTracker and Symbolic JIT.\r\n\t- These two things combined allow models with changing shapes to be jitted like transformers.\r\n\t- This means that LLaMA can now be jitted for a massive increase in performance.\r\n\t- Be warned that the API for this is very WIP and may change in the future, similarly with the rest of the tinygrad API.\r\n- [aarch64](\u002Ftinygrad\u002Frenderer\u002Fassembly_arm64.py) and [ptx](\u002Ftinygrad\u002Frenderer\u002Fassembly_ptx.py) assembly backend.\r\n- WebGPU backend, see the [`compile_efficientnet.py`](\u002Fexamples\u002Fcompile_efficientnet.py) example.\r\n- Support for torch like tensor indexing by other tensors.\r\n- Some more `nn` layers were promoted, namely `Embedding` and various `Conv` layers.\r\n- [VITS](\u002Fexamples\u002Fvits.py) and [so-vits-svc](\u002Fexamples\u002Fso_vits_svc.py) examples added.\r\n- Initial documentation work.\r\n\t- Quickstart guide: [`\u002Fdocs\u002Fquickstart.md`](\u002Fdocs\u002Fquickstart.md)\r\n\t- Environment variable reference: [`\u002Fdocs\u002Fenv_vars.md`](\u002Fdocs\u002Fenv_vars.md)\r\n\r\nAnd lots of small optimizations all over the codebase.\r\n\r\n### See the full changelog: https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fcompare\u002Fv0.6.0...v0.7.0\r\n\r\n### See the known issues: https:\u002F\u002Fgithub.com\u002Ftinygrad\u002Ftinygrad\u002Fissues?q=is%3Aissue+is%3Aopen+label%3Abug+sort%3Aupdated-desc\r\n\r\n### Join the [Discord](https:\u002F\u002Fdiscord.gg\u002FbeYbxwxVdx)!","2023-08-27T16:40:37",{"id":224,"version":225,"summary_zh":226,"released_at":227},314516,"v0.6.0","2516 lines now. Some day I promise a release will make it smaller.\r\n* float16 support (needed for LLaMA)\r\n* Fixed critical bug in training BatchNorm\r\n* Limited support for multiple GPUs\r\n* ConvNeXt + several MLPerf models in models\u002F\r\n* More torch-like methods in tensor.py\r\n* Big refactor of the codegen into the Linearizer and CStyle\r\n* Removed CompiledBuffer, use the LazyBuffer ShapeTracker","2023-05-26T01:02:57",{"id":229,"version":230,"summary_zh":231,"released_at":232},314517,"v0.5.0","An upsetting 2223 lines of code, but so much great stuff!\r\n\r\n* 7 backends : CLANG, CPU, CUDA, GPU, LLVM, METAL, and TORCH\r\n* A TinyJit for speed (decorate your GPU function today)\r\n* Support for a lot of onnx, including all the models in the backend tests\r\n* No more MLOP convs, all HLOP (autodiff for convs)\r\n* Improvements to shapetracker and symbolic engine\r\n* 15% faster at running the openpilot model","2023-03-07T02:21:19",{"id":234,"version":235,"summary_zh":236,"released_at":237},314518,"v0.4.0","So many changes since 0.3.0\r\n\r\nFairly stable and correct, though still not fast. The hlops\u002Fmlops are solid, just needs work on the llops.\r\n\r\nThe first automated release, so hopefully it works?","2022-11-08T16:49:28"]