[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-Xilinx--brevitas":3,"tool-Xilinx--brevitas":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 真正成长为懂上",160015,2,"2026-04-18T11:30:52",[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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",109154,"2026-04-18T11:18:24",[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":72,"owner_name":72,"owner_avatar_url":73,"owner_bio":74,"owner_company":75,"owner_location":75,"owner_email":75,"owner_twitter":75,"owner_website":76,"owner_url":77,"languages":78,"stars":98,"forks":99,"last_commit_at":100,"license":101,"difficulty_score":32,"env_os":102,"env_gpu":103,"env_ram":104,"env_deps":105,"category_tags":110,"github_topics":111,"view_count":32,"oss_zip_url":75,"oss_zip_packed_at":75,"status":17,"created_at":121,"updated_at":122,"faqs":123,"releases":152},9216,"Xilinx\u002Fbrevitas","brevitas","Brevitas: neural network quantization in PyTorch","Brevitas 是一款基于 PyTorch 的开源神经网络量化工具库，旨在帮助开发者将高精度的深度学习模型转化为更适合边缘设备部署的低精度版本。它主要解决了模型在资源受限硬件上运行效率低、内存占用大的痛点，通过降低数值精度（如从 32 位浮点数转为 8 位整数），显著减少计算量和存储需求，同时尽量保持模型准确率。\n\n这款工具特别适合人工智能研究人员、算法工程师以及需要在 FPGA 或嵌入式设备上部署模型的开发者使用。Brevitas 的核心优势在于其灵活性，它同时支持“训练后量化”（PTQ）和“量化感知训练”（QAT）两种主流技术路线。用户可以对模型中不同层级的输入、权重、偏置等张量进行细粒度的独立配置，轻松调整位宽和缩放粒度。此外，Brevitas 提供了丰富的预置量化层（如 QuantConv2d、QuantLSTM 等），能够无缝替换标准 PyTorch 层，让量化流程更加顺畅。作为由 Xilinx 团队维护的研究项目，Brevitas 为探索高效神经网络部署提供了强大且易用的技术支撑。","# Brevitas\n\n[![Downloads](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FXilinx_brevitas_readme_78a9dd5567e6.png)](https:\u002F\u002Fpepy.tech\u002Fproject\u002Fbrevitas)\n[![Pytest](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Factions\u002Fworkflows\u002Fpytest.yml\u002Fbadge.svg?branch=master)](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Factions\u002Fworkflows\u002Fpytest.yml)\n[![Examples Pytest](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Factions\u002Fworkflows\u002Fexamples_pytest.yml\u002Fbadge.svg?branch=master)](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Factions\u002Fworkflows\u002Fexamples_pytest.yml)\n[![DOI](https:\u002F\u002Fzenodo.org\u002Fbadge\u002F140494324.svg)](https:\u002F\u002Fzenodo.org\u002Fbadge\u002Flatestdoi\u002F140494324)\n\nBrevitas is a PyTorch library for neural network quantization, with support for both *post-training quantization (PTQ)* and *quantization-aware training (QAT)*.\n\n**Please note that Brevitas is a research project and not an official Xilinx product.**\n\nIf you like this project please consider ⭐ this repo, as it is the simplest and best way to support it.\n\n## Requirements\n\n* Python >= 3.9, \u003C3.13\n* [Pytorch](https:\u002F\u002Fpytorch.org) >= 1.12, \u003C= 2.8 (more recent versions would be untested).\n* Windows, Linux or macOS.\n* GPU training-time acceleration (*Optional* but recommended).\n\n## Installation\n\nYou can install the latest release from PyPI:\n```bash\npip install brevitas\n```\n\n## Getting Started\n\nBrevitas currently offers quantized implementations of the most common PyTorch layers used in DNN under `brevitas.nn`, such as `QuantConv1d`, `QuantConv2d`, `QuantConvTranspose1d`, `QuantConvTranspose2d`, `QuantMultiheadAttention`, `QuantRNN`, `QuantLSTM` etc., for adoption within PTQ and\u002For QAT.\nFor each one of these layers, quantization of different tensors (inputs, weights, bias, outputs, etc) can be individually tuned according to a wide range of quantization settings.\n\nAs a reference for PTQ, Brevitas provides an example user flow for ImageNet classification models under [`brevitas_examples.imagenet_classification.ptq`](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fblob\u002Fmaster\u002Fsrc\u002Fbrevitas_examples\u002Fimagenet_classification\u002Fptq\u002Fptq_evaluate.py) that quantizes an input torchvision model using PTQ under different quantization configurations (e.g. bit-width, granularity of scale, etc).\n\nFor more info, checkout our [documentation](https:\u002F\u002Fxilinx.github.io\u002Fbrevitas\u002F).\n\n## Cite as\n\nIf you adopt Brevitas in your work, please cite it as:\n```\n@software{brevitas,\n  author       = {Franco, Giuseppe and Pappalardo, Alessandro and Fraser, Nicholas J},\n  title        = {Xilinx\u002Fbrevitas},\n  year         = {2025},\n  publisher    = {Zenodo},\n  doi          = {10.5281\u002Fzenodo.3333552},\n  url          = {https:\u002F\u002Fdoi.org\u002F10.5281\u002Fzenodo.3333552}\n}\n```\n\n## History\n\n- *2025\u002F08\u002F28* - Release version 0.12.1, see the [release notes](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.12.1).\n- *2025\u002F05\u002F09* - Release version 0.12.0, see the [release notes](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.12.0).\n- *2024\u002F10\u002F10* - Release version 0.11.0, see the [release notes](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.11.0).\n- *2024\u002F07\u002F23* - Minor release version 0.10.3, see the [release notes](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.10.3).\n- *2024\u002F02\u002F19* - Minor release version 0.10.2, see the [release notes](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.10.2).\n- *2024\u002F02\u002F15* - Minor release version 0.10.1, see the [release notes](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.10.1).\n- *2023\u002F12\u002F08* - Release version 0.10.0, see the [release notes](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.10.0).\n- *2023\u002F04\u002F28* - Minor release version 0.9.1, see the [release notes](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.9.1).\n- *2023\u002F04\u002F21* - Release version 0.9.0, see the [release notes](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.9.0).\n- *2023\u002F01\u002F10* - Release version 0.8.0, see the [release notes](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.8.0).\n- *2021\u002F12\u002F13* - Release version 0.7.1, fix a bunch of issues. Added TVMCon 2021 tutorial notebook.\n- *2021\u002F11\u002F03* - Re-release version 0.7.0 (build 1) on PyPI to fix a packaging issue.\n- *2021\u002F10\u002F29* - Release version 0.7.0, see the [release notes](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.7.0).\n- *2021\u002F06\u002F04* - Release version 0.6.0, see the [release notes](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.6.0).\n- *2021\u002F05\u002F24* - Release version 0.5.1, fix a bunch of minor issues. See [release notes](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.5.1).\n- *2021\u002F05\u002F06* - Release version 0.5.0, see the [release notes](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.5.0).\n- *2021\u002F03\u002F15* - Release version 0.4.0, add support for \\_\\_torch_function\\_\\_ to QuantTensor.\n- *2021\u002F03\u002F04* - Release version 0.3.1, fix bug w\u002F act initialization from statistics w\u002F IGNORE_MISSING_KEYS=1.\n- *2021\u002F03\u002F01* - Release version 0.3.0, implements enum and shape solvers within extended dependency injectors. This allows declarative quantizers to be self-contained.\n- *2021\u002F02\u002F04* - Release version 0.2.1, includes various bugfixes of QuantTensor w\u002F zero-point.\n- *2021\u002F01\u002F30* - First release version 0.2.0 on PyPI.\n","# Brevitas\n\n[![下载量](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FXilinx_brevitas_readme_78a9dd5567e6.png)](https:\u002F\u002Fpepy.tech\u002Fproject\u002Fbrevitas)\n[![Pytest](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Factions\u002Fworkflows\u002Fpytest.yml\u002Fbadge.svg?branch=master)](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Factions\u002Fworkflows\u002Fpytest.yml)\n[![示例 Pytest](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Factions\u002Fworkflows\u002Fexamples_pytest.yml\u002Fbadge.svg?branch=master)](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Factions\u002Fworkflows\u002Fexamples_pytest.yml)\n[![DOI](https:\u002F\u002Fzenodo.org\u002Fbadge\u002F140494324.svg)](https:\u002F\u002Fzenodo.org\u002Fbadge\u002Flatestdoi\u002F140494324)\n\nBrevitas 是一个用于神经网络量化的小工具库，基于 PyTorch 构建，同时支持 *训练后量化 (PTQ)* 和 *量化感知训练 (QAT)*。\n\n**请注意，Brevitas 是一项研究项目，并非 Xilinx 的正式产品。**\n\n如果您喜欢这个项目，请考虑为本仓库点个赞（⭐），这是支持该项目最简单有效的方式。\n\n## 环境要求\n\n* Python >= 3.9, \u003C3.13\n* [Pytorch](https:\u002F\u002Fpytorch.org) >= 1.12, \u003C= 2.8（较新版本可能未经测试）。\n* Windows、Linux 或 macOS。\n* 训练时 GPU 加速（可选，但推荐使用）。\n\n## 安装\n\n您可以从 PyPI 安装最新版本：\n```bash\npip install brevitas\n```\n\n## 快速入门\n\n目前，Brevitas 在 `brevitas.nn` 中提供了深度神经网络中常用 PyTorch 层的量化实现，例如 `QuantConv1d`、`QuantConv2d`、`QuantConvTranspose1d`、`QuantConvTranspose2d`、`QuantMultiheadAttention`、`QuantRNN`、`QuantLSTM` 等，可用于 PTQ 和\u002F或 QAT 流程。对于这些层中的每个，都可以根据多种量化设置单独调整不同张量（输入、权重、偏置、输出等）的量化方式。\n\n作为 PTQ 的参考，Brevitas 提供了一个针对 ImageNet 分类模型的用户流程示例，位于 [`brevitas_examples.imagenet_classification.ptq`](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fblob\u002Fmaster\u002Fsrc\u002Fbrevitas_examples\u002Fimagenet_classification\u002Fptq\u002Fptq_evaluate.py)，该示例展示了如何使用不同的量化配置（如位宽、尺度粒度等）对 torchvision 中的输入模型进行 PTQ 量化。\n\n更多信息请参阅我们的 [文档](https:\u002F\u002Fxilinx.github.io\u002Fbrevitas\u002F)。\n\n## 引用方式\n\n如果您在工作中采用了 Brevitas，请按以下方式引用：\n```\n@software{brevitas,\n  author       = {Franco, Giuseppe and Pappalardo, Alessandro and Fraser, Nicholas J},\n  title        = {Xilinx\u002Fbrevitas},\n  year         = {2025},\n  publisher    = {Zenodo},\n  doi          = {10.5281\u002Fzenodo.3333552},\n  url          = {https:\u002F\u002Fdoi.org\u002F10.5281\u002Fzenodo.3333552}\n}\n```\n\n## 版本历史\n\n- *2025年8月28日* - 发布版本 0.12.1，查看 [发布说明](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.12.1)。\n- *2025年5月9日* - 发布版本 0.12.0，查看 [发布说明](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.12.0)。\n- *2024年10月10日* - 发布版本 0.11.0，查看 [发布说明](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.11.0)。\n- *2024年7月23日* - 小版本 0.10.3，查看 [发布说明](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.10.3)。\n- *2024年2月19日* - 小版本 0.10.2，查看 [发布说明](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.10.2)。\n- *2024年2月15日* - 小版本 0.10.1，查看 [发布说明](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.10.1)。\n- *2023年12月8日* - 发布版本 0.10.0，查看 [发布说明](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.10.0)。\n- *2023年4月28日* - 小版本 0.9.1，查看 [发布说明](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.9.1)。\n- *2023年4月21日* - 发布版本 0.9.0，查看 [发布说明](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.9.0)。\n- *2023年1月10日* - 发布版本 0.8.0，查看 [发布说明](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.8.0)。\n- *2021年12月13日* - 发布版本 0.7.1，修复了多个问题，并添加了 TVMCon 2021 教程笔记本。\n- *2021年11月3日* - 在 PyPI 上重新发布了版本 0.7.0（构建 1），以修复打包问题。\n- *2021年10月29日* - 发布版本 0.7.0，查看 [发布说明](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.7.0)。\n- *2021年6月4日* - 发布版本 0.6.0，查看 [发布说明](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.6.0)。\n- *2021年5月24日* - 发布版本 0.5.1，修复了一些小问题，查看 [发布说明](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.5.1)。\n- *2021年5月6日* - 发布版本 0.5.0，查看 [发布说明](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Freleases\u002Ftag\u002Fv0.5.0)。\n- *2021年3月15日* - 发布版本 0.4.0，为 QuantTensor 添加了 \\_\\_torch_function\\_\\_ 支持。\n- *2021年3月4日* - 发布版本 0.3.1，修复了在 IGNORE_MISSING_KEYS=1 情况下从统计信息初始化激活值时的 bug。\n- *2021年3月1日* - 发布版本 0.3.0，在扩展依赖注入器中实现了枚举和形状求解器，使声明式量化器能够自包含。\n- *2021年2月4日* - 发布版本 0.2.1，包含对带有零点的 QuantTensor 的多项修复。\n- *2021年1月30日* - 首次在 PyPI 上发布版本 0.2.0。","# Brevitas 快速上手指南\n\nBrevitas 是一个基于 PyTorch 的神经网络量化工具库，支持**训练后量化 (PTQ)** 和 **量化感知训练 (QAT)**。它提供了常用的量化层实现（如 `QuantConv2d`、`QuantLinear` 等），允许用户对输入、权重、偏置和输出等不同张量进行细粒度的量化配置。\n\n> **注意**：Brevitas 是 Xilinx 的研究项目，并非官方正式产品。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**：Windows、Linux 或 macOS\n*   **Python 版本**：>= 3.9 且 \u003C 3.13\n*   **PyTorch 版本**：>= 1.12 且 \u003C= 2.8（更高版本未经过测试）\n*   **硬件加速**：GPU（可选，但强烈建议在训练时使用以加速）\n\n## 安装步骤\n\n您可以通过 PyPI 直接安装最新稳定版。国内用户建议使用清华源或阿里源以提升下载速度。\n\n**使用默认源安装：**\n```bash\npip install brevitas\n```\n\n**使用国内镜像源安装（推荐）：**\n```bash\npip install brevitas -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n## 基本使用\n\nBrevitas 的核心功能位于 `brevitas.nn` 模块下，提供了标准 PyTorch 层的量化版本。您可以直接将模型中的普通层替换为对应的量化层来启用量化功能。\n\n以下是一个最简单的示例，展示如何将标准的 `Conv2d` 层替换为 `QuantConv2d` 并配置量化参数：\n\n```python\nimport torch\nimport torch.nn as nn\nfrom brevitas.nn import QuantConv2d, QuantReLU\n\n# 定义一个简单的量化模型\nclass QuantizedModel(nn.Module):\n    def __init__(self):\n        super(QuantizedModel, self).__init__()\n        # 使用 QuantConv2d 替代 nn.Conv2d\n        # bit_width 参数控制量化位宽，此处设为 8 bit\n        self.conv = QuantConv2d(\n            in_channels=3, \n            out_channels=16, \n            kernel_size=3,\n            weight_bit_width=8\n        )\n        # 使用 QuantReLU 替代 nn.ReLU\n        self.act = QuantReLU(act_quant_type='INT')\n\n    def forward(self, x):\n        x = self.conv(x)\n        x = self.act(x)\n        return x\n\n# 实例化模型\nmodel = QuantizedModel()\n\n# 创建虚拟输入数据进行测试\ninput_tensor = torch.randn(1, 3, 32, 32)\noutput = model(input_tensor)\n\nprint(f\"输入形状：{input_tensor.shape}\")\nprint(f\"输出形状：{output.shape}\")\n```\n\n对于完整的训练后量化 (PTQ) 流程（例如针对 ImageNet 分类模型），建议参考官方提供的示例脚本 [`brevitas_examples.imagenet_classification.ptq`](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fblob\u002Fmaster\u002Fsrc\u002Fbrevitas_examples\u002Fimagenet_classification\u002Fptq\u002Fptq_evaluate.py)，其中包含了不同量化配置（如位宽、缩放粒度等）的具体用法。\n\n更多详细文档请访问：[https:\u002F\u002Fxilinx.github.io\u002Fbrevitas\u002F](https:\u002F\u002Fxilinx.github.io\u002Fbrevitas\u002F)","某边缘计算团队正致力于将高精度的 ResNet-50 图像分类模型部署到资源受限的 FPGA 加速卡上，以满足工业质检的实时性要求。\n\n### 没有 brevitas 时\n- **手动改造繁琐**：开发者需逐个替换 PyTorch 原生层为自定义量化层，代码侵入性强且极易出错，维护成本极高。\n- **精度损失不可控**：缺乏系统的量化感知训练（QAT）流程，直接进行后训练量化导致模型在边缘端准确率断崖式下跌，无法满足业务指标。\n- **硬件适配困难**：难以精细调整权重、激活值等不同张量的位宽与粒度，导致生成的模型无法匹配特定硬件的算力单元，推理延迟反而增加。\n- **实验迭代缓慢**：每次尝试新的量化配置（如从 8 比特降至 4 比特）都需要重写大量底层逻辑，严重拖慢算法验证周期。\n\n### 使用 brevitas 后\n- **无缝集成替换**：直接调用 `brevitas.nn` 中预置的 `QuantConv2d` 等模块即可替换原生层，支持标准 PyTorch 训练循环，大幅降低开发门槛。\n- **精度几乎无损**：利用内置的 QAT 流程模拟低精度噪声，使模型在 4 比特量化下仍保持接近浮点模型的分类准确率，顺利达到上线标准。\n- **灵活细粒度配置**：可独立调节输入、权重及输出的量化参数，轻松生成专为 FPGA 架构优化的模型结构，推理速度提升 3 倍以上。\n- **高效探索配置**：通过简洁的 API 快速切换不同位宽和量化策略，团队在一天内即可完成多种方案的对比验证，显著加速产品落地。\n\nbrevitas 通过标准化的量化原语与全流程支持，让深度学习模型在边缘硬件上的高效部署从“手工定制”变为“流水线作业”。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FXilinx_brevitas_3a405cf4.png","Xilinx","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FXilinx_f160a5e5.png","GitHub.Com\u002FXilinx\u002F",null,"www.amd.com","https:\u002F\u002Fgithub.com\u002FXilinx",[79,83,87,91,95],{"name":80,"color":81,"percentage":82},"Python","#3572A5",89.2,{"name":84,"color":85,"percentage":86},"Jupyter Notebook","#DA5B0B",10.6,{"name":88,"color":89,"percentage":90},"C++","#f34b7d",0.2,{"name":92,"color":93,"percentage":94},"Makefile","#427819",0,{"name":96,"color":97,"percentage":94},"HTML","#e34c26",1522,243,"2026-04-16T14:05:55","NOASSERTION","Windows, Linux, macOS","非必需，但推荐用于训练加速（未指定具体型号、显存或 CUDA 版本）","未说明",{"notes":106,"python":107,"dependencies":108},"该项目是 Xilinx 的研究项目而非官方产品。支持训练后量化 (PTQ) 和量化感知训练 (QAT)。较新的 PyTorch 版本（超过 2.8）尚未经过测试。",">=3.9, \u003C3.13",[109],"torch>=1.12, \u003C=2.8",[14],[112,113,64,114,115,116,117,118,119,120],"quantization","pytorch","fpga","neural-networks","hardware-acceleration","xilinx","deep-learning","ptq","qat","2026-03-27T02:49:30.150509","2026-04-19T03:03:46.047774",[124,129,133,138,142,147],{"id":125,"question_zh":126,"answer_zh":127,"source_url":128},41373,"导出量化模型时遇到 'Module not supported for export' 错误怎么办？","在保存或导出量化模型之前，务必先对量化模型执行至少一次前向传播（forward pass）。这是因为某些量化参数需要通过前向传播来进行初始化。如果跳过这一步直接导出，可能会因为参数未初始化而报错。\n\n示例代码：\n```python\nmodel.eval()\n# 执行一次前向传播以初始化量化参数\n_ = model(torch.randn(1, 3, 224, 224))\n# 然后再进行导出或保存\nexport_torch_qcdq(model, ...)\n```","https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fissues\u002F1091",{"id":130,"question_zh":131,"answer_zh":132,"source_url":128},41374,"只保存模型的 state_dict 时，是否需要使用上下文管理器或删除 injector？","如果您只是存储模型的 state_dict（状态字典），而不是序列化整个模型对象（即不使用 `torch.save(model, ...)` 保存整个模型），则不需要使用上下文管理器或删除 injector。这部分操作仅在尝试序列化整个模型时才需要。\n\n推荐做法：\n```python\nmodel = qnn.QuantLinear(3, 8)\nmodel.eval() # 切换到评估模式以避免训练相关的保存错误\nb = model(torch.randn(1, 3)) # 确保参数已初始化\ntorch.save(model.state_dict(), \"test_dict.pickle\") # 仅保存状态字典\n```",{"id":134,"question_zh":135,"answer_zh":136,"source_url":137},41375,"在进行 PTQ（训练后量化）校准时，如何解决 CUDA 设备配置问题？","如果遇到 CUDA 相关问题，需要修改校准函数（calibrate function），显式地将输入数据移动到 CUDA 设备上。假设模型已经移动到了 CUDA 设备，校准函数应如下编写：\n\n```python\ndef calibrate(model, data_loader, device):\n    with torch.no_grad():\n        # 校准模式\n        with calibration_mode(model):\n            for _, data in enumerate(tqdm(data_loader)):\n                images = data[\"image\"]\n                images = images.to(device, non_blocking=True) # 关键步骤：数据移至 GPU\n                model(images)\n\n        # 偏置校正模式\n        with bias_correction_mode(model):\n            for _, data in enumerate(tqdm(data_loader)):\n                images = data[\"image\"]\n                images = images.to(device, non_blocking=True) # 关键步骤：数据移至 GPU\n                model(images)\n    return model\n```","https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fissues\u002F517",{"id":139,"question_zh":140,"answer_zh":141,"source_url":137},41376,"MobileNet-v1 量化模型的校准数据集大小对精度有何影响？","根据用户实测数据，在使用 BIT_WIDTH=8 的配置对 MobileNet 进行校准时：\n1. 使用 16,000 张图像的数据集进行校准，可获得约 72.6% 的准确率。\n2. 将数据集增加到 64,000 张图像，准确率基本保持不变。\n这意味着对于该模型和配置，增加校准数据量超过一定阈值后，收益可能不再显著。",{"id":143,"question_zh":144,"answer_zh":145,"source_url":146},41377,"如何在自定义 QuantConv2d 层中控制权重量化时机或在导出时获取修改后的量化权重？","在 Brevitas 中，通常依赖 `self.weight` 进行量化。如果您需要对权重进行预处理（在全精度下操作）然后再量化，可以使用 PyTorch 的 `parametrize` 功能。关于导出时的行为：使用 `parametrize` 后，`quant_weight().value` 返回的是去量化版本还是原始参数版本取决于具体实现，但核心思路是 Brevitas 会处理 `self.weight` 的量化逻辑。\n\n建议调试确认：由于 `parametrize` 的具体行为可能随版本变化，建议在导出前使用调试器检查 `quant_weight().value` 和 `self.parametrizations.weight.original` 的值，确保导出模型时得到的是您预期的量化版本权重。最新版本的 Brevitas 已支持此类工作流。","https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fissues\u002F1123",{"id":148,"question_zh":149,"answer_zh":150,"source_url":151},41378,"运行 Brevitas 示例时遇到 'Input scale required' 错误是什么意思？如何解决？","'Input scale required' 错误通常意味着量化层（如 QuantConv2d）在执行前向传播时，未能获取到输入数据的缩放因子（scale）。\n\n解决方法：\n1. **检查输入层**：确保模型的第一个层是量化感知层（如 `QuantIdentity`），并且设置了 `return_quant_tensor=True`。这样它会将包含 scale 信息的 QuantTensor 传递给后续层。\n   ```python\n   self.quant_inp = qnn.QuantIdentity(bit_width=4, return_quant_tensor=True)\n   ```\n2. **输入数据类型**：Brevitas 的量化层（如 `qnn.QuantLinear`, `qnn.QuantConv2d`）通常接收浮点数（float）作为输入，但要求该输入必须经过前面的量化层处理成 `QuantTensor` 对象，或者在特定配置下由层内部处理。不要直接传入 int 或 uint8 类型的原始张量，除非您手动构建了 QuantTensor。\n3. **完整链路**：确保从输入到报错层之间的所有中间层都正确配置了 `return_quant_tensor=True`，以便 scale 信息能逐层传递。","https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fissues\u002F423",[153,158,163,168,173,178,183,188,193,198,203,208,213,218,223,228,233,238,243,248],{"id":154,"version":155,"summary_zh":156,"released_at":157},333349,"v0.12.1","## 亮点\n* 新增\u002F更新的 PTQ 算法：\n  * Qronos 支持 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1311\n  * 旋转均衡的修复与改进 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1310, https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1312\n  * 类似 DDP 的偏置校正，用于 SDXL（实验性）https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1342\n* 层支持的改进：\n  * 在无 FP32 计算的情况下对 SDPA 进行量化 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1299\n* 新的导出流程：\n  * 初步的 SHARK 导出支持：https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1300\n  * 初步的 GGUF 导出：https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1291\n* 示例的改进：\n  * Qronos 示例（论文：https:\u002F\u002Farxiv.org\u002Fabs\u002F2505.11695）https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1326\n  * 针对 Stable Diffusion 和 ImageNet 的“基准”实验 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1281\n  * 训练后模型扩展示例（论文：https:\u002F\u002Farxiv.org\u002Fabs\u002F2503.17513）https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1355\n* 允许使用有符号缩放 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1308\n* 带 `dynamo=True` 的 QONNX 导出 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1234\n\n## 变更内容\n* 修复（设置）：解决 isort 和 yapf 之间的不兼容问题，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1293 中完成\n* 功能（图\u002F哈达玛）：增加 152 个 had 支持，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1295 中实现\n* 功能（示例\u002FLLM）：完全参数化注意力机制的量化，由 @nickfraser 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1287 中实现\n* 功能（示例\u002FLLM）：“自动”数据类型，由 @pablomlago 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1301 中实现\n* 设置：更新 transformers 版本，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1304 中完成\n* 功能（brevitas_examples\u002FLLM）：在无 FP32 计算的情况下对 SDPA 进行量化，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1299 中实现\n* 修复（brevitas_examples\u002FLLM）：更新 README 和 YAML 文件，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1305 中完成\n* 设置：临时锁定 pytest 版本，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1307 中完成\n* 功能（brevitas_examples\u002FLLM）：可配置的扩展步骤，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1280 中实现\n* 文档中的版本控制支持，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1298 中实现\n* 功能（图\u002F旋转）：改进 SDPA 中的 R2 区域，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1310 中实现\n* 文档：改进文档构建，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1314 中完成\n* 修复（图\u002F旋转）：针对 SDPA 的部分通道进行旋转，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1312 中完成\n* 功能（brevitas_examples\u002FLLM）：GGUF 导出，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1291 中实现\n* 设置：提升 torch 版本，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1205 中完成\n* 修复（示例\u002FImageNet）：在 ImageNet PTQ 示例中添加前向传播，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1316 中完成\n* 功能（qronos）：Qronos 的初步实现，由 @i-colbert 在 https:\u002F\u002Fgith","2025-08-28T17:01:15",{"id":159,"version":160,"summary_zh":161,"released_at":162},333350,"v0.12.0","## 破坏性变更\n\n * TruncIntQuant、TruncAvgPool、Trunc QONNX 操作变更 #1042\n\n## 亮点\n\n * 新的 PTQ 算法：\n   * AWQ #1213\n   * MagR #1214\n   * QuaRot #1061\n   * SpinQuant #1155\n   * AutoRound #1064\n   * SVDQuant #1210\n * 新的数据类型支持\n   * 分层尺度 #1038\n * 初步支持 `torch.compile` #1206\n   * 用户指南 [在此](https:\u002F\u002Fxilinx.github.io\u002Fbrevitas\u002Fuser_guide\u002Fcompile.html)\n * 基于 YAML 的实验 #1116\n * LLM 示例的基准测试脚本 #1166\n * 新的操作符支持\n   * 更好的 SDPA 量化支持 #1090\n\n## 变更内容\n* 功能（示例\u002F生成）：@Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1046 中为 GPTQ 实现基于块的优化\n* 修复（learned_round）：@pablomlago 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1059 中禁用浮点推理期间返回 QuantTensor\n* 将 onnx 从 1.15 升级到 1.17.0，位于 \u002Frequirements 中，由 @dependabot 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1069 中完成\n* 修复（minifloat）：@Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1067 中修正了 minifloat 的计算和测试\n* 功能（ptq）：@i-colbert 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1060 中为 GPxQ 添加了累加器感知扩展\n* 功能：@Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1075 中添加了贡献指南\n* 功能（float）：@i-colbert 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1072 中为代理和量化张量添加了新属性\n* 功能（accelerate）：@Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1065 中提升了与 accelerate 的兼容性\n* 修复 Transformers 测试：@Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1081 中完成了修复\n* 修复（data）：@i-colbert 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1080 中更新了 wikitext2 数据工具\n* 修复（groupwise）：@Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1071 中修正了日志、groupdim 和尺度的计算\n* 测试（mx）：@Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1068 中为 MXFloat 添加了参考实现\n* 修复（示例\u002F生成）：@nickfraser 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1084 中修复了 `quantize_model` 的参数顺序\n* 功能（export）：@Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1070 中实现了 qonnx minifloat 导出\n* 功能（core）：@Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1037 中将尺度改为运行时参数\n* 修复（per_group）：@i-colbert 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1089 中修复了 per_group 对称量化器\n* 基于旋转的均衡化：@Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1061 中实现\n* 修复（示例\u002Fllm）：@Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1092 中修复了主文件和 README\n* 修复：@Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1077 中修正了输出尺度的计算\n* 修复（ptq\u002Frotation）：@Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1095 中修复了旋转实现的问题（#1095）\n* 修复（scaling）！：@Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpul 中通过钳位避免前向和反向传播中的 inf\u002Fnan","2025-05-09T15:31:31",{"id":164,"version":165,"summary_zh":166,"released_at":167},333351,"v0.11.0","## 破坏性变更\n* 移除 ONNX QOp 导出（https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F917）\n* QuantTensor 不允许出现空的元数据字段（例如 scale、bitwidth 等）（https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F819）\n* 偏置量化现在需要指定位宽（https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F839）\n* QuantLayer 不再直接暴露 quant_metadata，相关功能已委托给代理类（https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F883）\n* 已移除 QuantDropout（https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F861）\n* 已移除 QuantMaxPool（https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F858）\n\n\n\n## 亮点\n* 支持 OCP\u002FFNUZ FP8 量化\n    * 兼容 QAT\u002FPTQ，包括当前所有已实现的 PTQ 算法（GPTQ、LearnedRound、GPFQ 等）\n    * 可完全自定义 minifloat 配置（即选择尾数\u002F指数位宽、指数偏置等）\n    * 支持 ONNX QDQ 导出\n\n* 支持 OCP MX 量化\n   * 兼容 QAT\u002FPTQ，包括当前所有已实现的 PTQ 算法（GPTQ、LearnedRound、GPFQ 等）\n   * 可完全自定义 minifloat 配置（即选择尾数\u002F指数位宽、指数偏置、分组大小等）\n\n* 新的 QuantTensor 支持：\n    * FloatQuantTensor：支持 OCP FP 格式及通用 minifloat 量化\n    * GroupwiseQuantTensor：支持 OCP MX 格式及通用分组 int\u002Fminifloat 量化\n\n* 支持通道拆分\n\n* 支持针对零点的 HQO 优化\n\n* 支持针对 scale 的 HQO 优化（原型）\n\n* 在 brevitas_examples 中改进了 SDXL 入口\n\n* 在 brevitas_examples 中改进了 LLM 入口\n    * 兼容 accelerate\n\n* 对 `torch.compile` 的原型支持：\n    * 请查看 PR https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F1006，了解如何使用该功能的示例\n\n## 变更内容\n如需更全面的变更和修复列表，请参阅下方：\n\n* 增强：在偏置校正后导入量化模型，由 @costigt-dev 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F868 中实现\n* 修复 QCDQDecoupledWeightQuantProxyHandlerMixin 返回参数问题，由 @costigt-dev 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F870 中完成\n* 修复 —— 语音转文本：创建空 JSON 文件，由 @costigt-dev 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F871 中完成\n* 功能（扩展\u002F独立）：添加标志以获取完整 state dict，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F874 中实现\n* 笔记本：使笔记本运行结果确定性，并打印断言输出，由 @fabianandresgrob 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F847 中完成\n* 修复（代理）：回滚 value tracer 的更改，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F888 中完成\n* 修复（代理）：修复属性获取问题，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F880 中完成\n* 功能（笔记本）：添加动态量化导出到 ONNX 的示例，由 @fabianandresgrob 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F877 中实现\n* 修复（gpxq）：处理 e","2024-10-10T12:31:33",{"id":169,"version":170,"summary_zh":171,"released_at":172},333352,"v0.10.3","## 变更内容\n* 后向移植：修复（export\u002Fqonnx）：修复了符号关键字参数的顺序问题。（#988）由 @nickfraser 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F992 中完成\n* 设置了 `numpy` 版本、`ONNX` 版本以及 `setuptools` 的最大版本\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fcompare\u002Fv0.10.2...v0.10.3","2024-07-23T13:48:02",{"id":174,"version":175,"summary_zh":176,"released_at":177},333353,"v0.10.2","## 变更内容\n* 修复（QuantLayer）：使 QuantLayer 的偏置变为可选，由 @fabianandresgrob 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F846 中完成\n* 修复（examples\u002Fllm）：仅在分组量化时设置 `group_size`，由 @nickfraser 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F853 中完成\n* 修复（gpfq）：更新 GPFA2Q 的输入处理和 L1 范数约束，由 @i-colbert 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F852 中完成\n* 修复 ImageNet PTQ 示例，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F863 中完成\n* 功能（gen\u002Fquantize）：向 `quantize_model` 添加了设备标志，由 @nickfraser 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F860 中完成\n* 文档：更新 0.10.2 版本的 README，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F865 中完成\n\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fcompare\u002Fv0.10.1...v0.10.2","2024-02-19T16:37:15",{"id":179,"version":180,"summary_zh":181,"released_at":182},333354,"v0.10.1","## 亮点\n* A2Q+ 支持 [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2401.10432)\n* 基于 CIFAR10 和超分辨率的 A2Q+ 示例\n* 支持权重和激活的拼接均衡化\n* 支持 GPFQ + A2Q L1 范数约束\n* 在 QCDQ 导出中可显式导出权重的量化节点\n* QCDQ 导出支持 float16 和 bfloat16 数据类型\n* ONNX QDQ 导出支持动态激活量化\n* 支持通道拆分 [论文](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1901.09504.pdf)\n* （测试版）与 Huggingface accelerate 和 optimum 的兼容性更好\n* （测试版）改进了对 minifloat 量化支持及测试\n\n## 变更内容\n* 修复（示例\u002F生成模型）：在 weight_quant 中设置 weight_bit_width，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F783 中完成\n* 功能（图\u002F均衡化）：针对 LLM 均衡化的改进，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F784 中完成\n* [图] 修复类名中的拼写错误，由 @nickfraser 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F765 中完成\n* 修复（图\u002F均衡化）：针对激活均衡化的重构，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F787 中完成\n* [quant_tensor] 更新 `__truediv__` 行为以符合“标准定点规则”，由 @nickfraser 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F769 中完成\n* 功能（导出）：为 qcdq 导出添加 (b)float16 支持，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F776 中完成\n* 功能（PTQ）：向 GPFQ 添加 A2Q 上界裁剪功能，由 @fabianandresgrob 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F734 中完成\n* 扩展均衡化功能，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F778 中完成\n* 改进 bfloat16 支持，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F777 中完成\n* 修复（统计信息）：在 state_dict 中添加返回语句，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F792 中完成\n* 修复（均衡化）：改进 cat eq 检查，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F793 中完成\n* 修复（导出）：添加 CastMixin 类，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F794 中完成\n* 支持动态激活量化，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F796 中完成\n* 修复（示例\u002F量化器）：修正动态零点处理问题，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F806 中完成\n* 功能（a2q+）：改进累加器感知的权重量化，由 @i-colbert 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F797 中完成\n* 功能（a2q+）：将新的超分辨率模型加入 brevitas_examples，由 @i-colbert 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F811 中完成\n* 功能（通道拆分）：搭建通道拆分的初步框架，由 @fabianandresgrob 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F772 中完成\n* 功能：增加对 optimum 的支持，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F826 中完成\n* 修复（测试）：添加 FloatQuant 测试用例，由 @fabianandresgrob 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F815 中完成\n* 修复（导出）：修正 q 节点的导出问题，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F829 中完成\n* 修复（示例\u002FLLM）：修正分组导出问题，由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fb","2024-02-15T11:50:59",{"id":184,"version":185,"summary_zh":186,"released_at":187},333355,"a2q_cifar10_r1","本版本包含训练代码和预训练权重，用于在图像分类任务上演示累加器感知量化（A2Q）。同时，我们也提供了代码，以展示我们论文《A2Q+：改进累加器感知权重量化》（[https:\u002F\u002Farxiv.org\u002Fabs\u002F2401.10432](https:\u002F\u002Farxiv.org\u002Fabs\u002F2401.10432)）中提出的基于欧几里得投影的权重初始化方法（EP-init）。\n\n相关文档请参见：[https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Ftree\u002Fa2q_cifar10_r1\u002Fsrc\u002Fbrevitas_examples\u002Fimagenet_classification\u002Fa2q](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Ftree\u002Fa2q_cifar10_r1\u002Fsrc\u002Fbrevitas_examples\u002Fimagenet_classification\u002Fa2q)。","2024-02-12T18:17:37",{"id":189,"version":190,"summary_zh":191,"released_at":192},333356,"super_res_r2","# 使用 Brevitas 进行 A2Q+ 超分辨率实验\n\n本版本包含训练代码和预训练权重，用于在超分辨率任务上演示我们论文《A2Q+：改进累加器感知的权重量化》（[https:\u002F\u002Farxiv.org\u002Fabs\u002F2401.10432](https:\u002F\u002Farxiv.org\u002Fabs\u002F2401.10432)）中提出的累加器感知量化（A2Q+）方法。\n\n相关文档请参见：[https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Ftree\u002Fsuper_res_r2\u002Fsrc\u002Fbrevitas_examples\u002Fsuper_resolution](https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Ftree\u002Fsuper_res_r2\u002Fsrc\u002Fbrevitas_examples\u002Fsuper_resolution)。","2024-01-30T19:00:32",{"id":194,"version":195,"summary_zh":196,"released_at":197},333357,"v0.10.0","## 亮点\n* 支持 PyTorch 最高至 2.1 版本。\n* 支持 GPTQ PTQ 算法。\n* 支持 GPFQ PTQ 算法。\n* 支持 SmoothQuant \u002F 激活均衡 PTQ 算法。\n* 支持基于 MSE 的权重和激活缩放因子与零点计算。\n* 支持 QuantLinear 输入端的逐行缩放。\n* 支持对权重张量切片进行量化。\n* 全链路支持 ImageNet PTQ 中的可学习舍入。\n* 提供超分辨率任务上 A2Q（低精度累加）的端到端示例训练脚本。\n* 实验性支持 minifloat（eXmY 量化）。\n* 实验性 LLM PTQ 流程，支持仅权重量化和权重+激活量化，并集成 GPTQ、AWQ 和 SmoothQuant。\n* 实验性 Stable Diffusion PTQ 流程，支持仅权重量化。\n* 废弃 FINN ONNX 导出流程。\n* 将自定义 value_trace FX 追踪器更新至最新 FX 版本。\n* 新增 make_fx 追踪器的自定义变体，通过 @wrap 注解支持自定义 torch.library 操作。\n\n## 变更内容\n* 功能（nn）：由 @volcacius 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F628 中实现，缓存需要子张量切片的模块。\n* 功能：由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F626 中实现，支持 GPTQ 的切片功能。\n* 功能：由 @volcacius 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F625 中实现，为 QuantLinear 添加逐行输入量化支持。\n* 修复（nn）：由 @volcacius 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F633 中实现，禁用权重张量切片语法。\n* 功能（core）：由 @volcacius 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F634 中实现，添加用于子权重量化的 SliceTensor 工具。\n* 修复（core）：由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F635 中实现，补充缺失的 dtype 和 device 属性。\n* 功能（ptq）：由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F541 中实现，支持激活均衡。\n* 功能（fx）：由 @volcacius 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F636 中实现，改进 value_trace。\n* 修复（core\u002Futils）：由 @volcacius 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F637 中实现，修正 JIT 忽略 eager 模式下张量切片实现的问题。\n* 修复（weight_eq）：由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F638 中实现，修复 LLM 均衡相关问题。\n* 由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F640 中实现，补充缺失的许可证信息。\n* 功能（ptq）：由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F643 中实现，为视觉任务添加激活均衡支持。\n* 修复（tracer）：由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F644 中实现，支持索引操作及无追踪器操作。\n* 设置：由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F647 中实现，固定 inflect 版本以确保兼容性。\n* 由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F642 中实现，扩展激活均衡功能。\n* 修复（core）：由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F650 中实现，修正 ParameterFromStatsFromParameter 中的前向传播逻辑。\n* 功能（zero_point）：由 @Giuseppe5 在 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F651 中实现，采用网格搜索优化 MSE 零点计算。\n* 修复（weight_eq）：由 @Giuseppe5 在 https:\u002F\u002Fg 中实现，正确处理 layernorm\u002Fbatchnorm 作为 sink。","2023-12-08T16:36:41",{"id":199,"version":200,"summary_zh":201,"released_at":202},333358,"super_res_r1","# 使用 Brevitas 进行整数量化超分辨率实验\n\n本版本包含演示如何使用 Brevitas 训练整数量化超分辨率模型的脚本。同时，还提供了代码，用于展示我们在 ICCV 2023 论文《A2Q：具有保证溢出避免的累加器感知量化》（[arXiv:2308.13504](https:\u002F\u002Farxiv.org\u002Fabs\u002F2308.13504)）中提出的累加器感知量化（A2Q）方法。\n\n相关文档请参见：https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Ftree\u002Fsuper_res_r1\u002Fsrc\u002Fbrevitas_examples\u002Fsuper_resolution 。","2023-09-20T16:07:08",{"id":204,"version":205,"summary_zh":206,"released_at":207},333359,"v0.9.1","## What's Changed\r\n* Setup: add requirements-dev with pre-commit by @Giuseppe5 in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F581\r\n* CI update by @Giuseppe5 in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F570\r\n* Fix (brevitas_examples\u002Fbnn_pynq): missing 4b resnet18 link and hash fn by @volcacius in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F583\r\n* Docs: update READMEs by @Giuseppe5 in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F584\r\n\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fcompare\u002Fv0.9.0...v0.9.1","2023-04-28T16:57:47",{"id":209,"version":210,"summary_zh":211,"released_at":212},333360,"v0.9.0","# Highlights\r\n* Initial support for graph quantization to programmatically generate a quantized model from a floating-point one. ImageNet examples with PTQ can be found here: https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Ftree\u002Fmaster\u002Fsrc\u002Fbrevitas_examples\u002Fimagenet_classification\u002Fptq .\r\n* Initial support for QuantMultiheadAttention, which is leveraged for e.g. ViT support above.\r\n* Various improvements to graph equalization, which are leveraged in the PTQ examples above.\r\n* New accumulation-aware quantizers, to train for low-precision accumulation, based on our A2Q paper https:\u002F\u002Farxiv.org\u002Fabs\u002F2301.13376 .\r\n* Experimental support for BatchQuant quantizer, based on https:\u002F\u002Farxiv.org\u002Fabs\u002F2105.08952 , currently still untested.\r\n* Initial support for learned rounding.\r\n \r\n# Overview of changes\r\n\r\n## Graph quantization\r\n\r\n* Initial graph quantization support by @Giuseppe5 in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F549 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F574 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F532 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F579\r\n\r\n## Quantized layers\r\n\r\n* Initial support for QuantMultiheadAttention https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F568\r\n* Breaking change: rename Quant(Adaptive)AvgPool to Trunc(Adaptive)AvgPool by @volcacius in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F562\r\n\r\n## Quantizers\r\n\r\n* Weight normalization-based integer quantizers by @i-colbert in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F559\r\n* Accumulator-aware weight quantization by @i-colbert in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F567\r\n* BatchQuant quantizers support by @volcacius in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F563\r\n\r\n## QuantTensor\r\n\r\n* Support to move QuantTensor across devices by @Giuseppe5 in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F528\r\n* Initial support for interpolate and pixel_shuffle by @volcacius in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F578\r\n\r\n## PTQ\r\n\r\n* Batch Norm support in graph equalization by @Giuseppe5 in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F531\r\n* Mul support in graph equalization by @Giuseppe5 in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F530\r\n* Learned round support by @Giuseppe5 in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F573\r\n* MultiheadAttention and LayerNorm support in graph equalization by @Giuseppe5 in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F555\r\n* Fix calibration over large number of batches by @Giuseppe5 in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F523\r\n\r\n## Export\r\n\r\n* Itemize scalar quantize args only in TorchScript QCDQ by @volcacius in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F561\r\n* Round avgpool export fixes by @volcacius in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F562\r\n\r\n## CI, linting\r\n\r\n* Linter isort by @Giuseppe5 in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F505\r\n* CI: bump isort from 5.10.1 to 5.11.5 by @Giuseppe5 in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F540\r\n* Test: enable parallelism with pytest-xdist by @Giuseppe5 in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F513\r\n* GHA workflow improvement by @Giuseppe5 in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F507\r\n* Add support for yapf by @Giuseppe5 in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F511\r\n\r\n## FX\r\n\r\n* Disable FX backport on 1.8.1+ by @volcacius in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F504\r\n\r\n## Examples\r\n* Pretrained Resnet18 example on CIFAR10 targeting FINN by @volcacius in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F577\r\n* Graph quantization + PTQ examples and benchmarking scripts by @Giuseppe5 in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F547  https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F575 https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F576\r\n\r\nFor the **Full Changelog** please check : https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fcompare\u002Fv0.8.0...v0.9.0","2023-04-21T17:50:01",{"id":214,"version":215,"summary_zh":216,"released_at":217},333361,"bnn_pynq-r2","Model definition and pretrained 4b variant of ResNet18 for FINN deployment. Available under the bnn_pynq examples:\r\n\r\n```python\r\nfrom brevitas_examples.bnn_pynq.models import resnet18_4w4a\r\nquant_model = resnet18_4w4a(pretrained=True)\r\n```","2023-04-20T12:17:46",{"id":219,"version":220,"summary_zh":221,"released_at":222},333362,"v0.8.0","## What's Changed\r\n* Add support for PyTorch 1.11-1.13.1. Brevitas 0.8 supports PyTorch 1.5.1 to 1.13.1, with 1.10+ suggested. \r\n* Deprecate support for Python 3.6, 3.7+ is now required.\r\n* Add support for export to ONNX QCDQ for \u003C= int8 quantization, for out of the box execution with onnxruntime or similar backends.\r\n* Extend support for export to ONNX QOps to \u003C= int8 quantization, for out of the box execution with onnxruntime or similar backends.\r\n* Add experimental support for export to torch QCDQ for \u003C= int32 quantization, as an entry point for future MLIR integration with torch-mlir.\r\n* Add support for QuantRNN, QuantLSTM, w\u002F support for CIFG, bidirectional layers, shared input-hidden gates, shared quantizers, training-time JIT compilation, and partial export support to ONNX (QONNX and QCDQ).\r\n* Improve support for zero-point for both weights and activations quantization.\r\n* New default asymmetric activation quantizer based on percentile rather than min\u002Fmax.\r\n* Add more built-in quantizers (symmetric per-channel, asymmetric per-channel, symmetric decoupled per-channel).\r\n* Simplify interface for activation calibration.\r\n* Simplify interface for bias correction.\r\n* Initial support for QuantEmbedding.\r\n* Deprecate support for XIR and PyXIR export flows.\r\n* Many bug fixes and minor improvements.\r\n\r\n## New Contributors\r\n* @fd0r made their first contribution in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F434\r\n* @omarperacha made their first contribution in https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F483\r\n* @andrei-stoian-zama made their first contribution https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fpull\u002F470\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fcompare\u002Fv0.7.1...v0.8.0","2023-01-10T09:09:41",{"id":224,"version":225,"summary_zh":226,"released_at":227},333363,"v0.7.1","## Fixes\r\n- Various issues in the arithmetic of QuantTensor\r\n- Remove a requirement on find_unused_parameters=True in DDP\r\n- Bias quantization not being enabled if bias is added to a layer post init\r\n- Sharing per-tensor weight quantizer\r\n- Improve implementation of zero-point from stats\r\n- Bias export in QOp ONNX\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fcompare\u002Fv0.7.0...v0.7.1","2021-12-14T11:10:46",{"id":229,"version":230,"summary_zh":231,"released_at":232},333364,"v0.7.0","## Breaking changes\r\n- DPUv1 specific export flow has been deprecated (since DPUv1 has been deprecated in Vitis AI).\r\n- Support for PyTorch \u003C 1.5 has been deprecated. \r\n- The previous implementation of graph quantization has been deprecated.\r\n\r\n## Fixes\r\n- Issues between statistics collection in quantized activations and BREVITAS_JIT=1 should be solved. \r\n- Statistics collection in quantized activations is now done with a Buffer before switching to a learned Parameter, to keep things consistent in distributed training.\r\n- Custom ONNX functions are now properly registered with PyTorch.\r\n- Various other minor fixes, see full changelog below.\r\n\r\n## Features\r\n- Support for various more operators in QuantTensor.\r\n- Initial support for post-training quantization through statistics collection, bias correction, and equalization.\r\n- Initial support for FX-based graph quantization, currently targeting FlexML (an internal toolchain) only.\r\n- Various other minor enhancements, see full changelog below. \r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002FXilinx\u002Fbrevitas\u002Fcompare\u002Fv0.6.0...v0.7.0","2021-10-29T11:02:34",{"id":234,"version":235,"summary_zh":236,"released_at":237},333365,"v0.6.0","# Breaking changes\r\n- Quantizers now require to specify a matching proxy class as `proxy_class` attribute. This is necessary to export more custom quantization techniques through BrevitasONNX. Quantization solvers like `WeightQuantSolver` already specify their corresponding `proxy_class`. Any custom quantizer that doesn't inherit from built-in solvers or quantizers will break.\r\n\r\n# Features\r\n- New `brevitas.fx` subpackage with:\r\n   - A backport of `torch.fx` from version 1.8.1 to earlier versions of PyTorch down to 1.3.1.\r\n   - A generalized tracer (`brevitas.fx.value_tracer`) that is capable of partially evaluating against the `concrete_args` without reducing down to constants, as illustrated here https:\u002F\u002Fgithub.com\u002Fpytorch\u002Fpytorch\u002Fissues\u002F56862. This allows to trace through conditionals and unpacking of tuples as long as representative input data is provided.\r\n   - A symbolic tracer that accounts for Brevitas layers as leaf modules (`brevitas.fx.brevitas_symbolic_trace`) and its generalized variant (`brevitas.fx.brevitas_value_trace`).\r\n- Port existing graph quantization transformations in `brevitas.graph` to `brevitas.fx`. Still not ready for easy public consumption, but useful to anyone that knows what they are doing.\r\n- Rewrite bias export in the FINN ONNX export flow.\r\n- Add DPURound, with matching STE implementations and wrappers.\r\n- Add matching implementations for the symbolic ops Quant and DecoupledQuant in the BrevitasONNX export flow.  \r\n\r\n# Bugfixes\r\n- Fix leftover issues with 16b datatypes not being preserved after quantization during mixed-precision training.\r\n- Fix per-channel quantization on QuantConvTranspose1d\u002F2d.\r\n- Fix per-channel quantization whenever two layers with quantized weights share the same quantizer.\r\n- Fix export from non-CPU devices.\r\n\r\n","2021-06-04T11:48:30",{"id":239,"version":240,"summary_zh":241,"released_at":242},333366,"v0.5.1","## Highlights\r\n\r\nMinor release with a bunch of fixes:\r\n- Fix compatibility with latest onnx (1.9+) by adding a dependency on onnxoptimizer.\r\n- Fix issues with calls to view on non-contiguous data in recent PyTorch versions by switching to reshape. \r\n- Fix a bunch of typos in the README.\r\n- Fix a casting issue that was preventing mixed-precision training from working (it's still generally not reccomended).\r\n\r\nThanks to all the contributors.","2021-05-24T12:59:28",{"id":244,"version":245,"summary_zh":246,"released_at":247},333367,"v0.5.0","# Highlights \r\n\r\n- Fix an issue with LOG_FP or POWER_OF_TWO restrictions on the scale factors, where the absolute value of the scale was incorrectly being computed before exponentiation. This is a breaking change that restores the (correct) behaviour implemented in earlier releases of Brevitas, and it restores the full accuracy of some pretrained models like QuartzNet. Training with those settings should now be more stable too. \r\n- Supporting solving enum directives in quantizers that default to None. This restores support for inline enum driven bias quantization that was previously silently failing.\r\n- Add support for exporting a whole Brevitas model to ONNX (down to all its low level operations) through a call to torch.onnx.export.\r\n- Initial support for a 'generic' proxy-level ONNX export flow, found under brevitas.export.onnx.generic.\r\n- Initial support for exporting to Xilinx's XIR format, found under brevitas.export.onnx.vitis_ai.xir.\r\n- Experimental novel quantized L2,inf weight norm quantizers with learned scale (Int4WeightPerTensorFloatDecoupled and Int4WeightPerTensorFixedPointDecoupled), for high accuracy with per-tensor scaling at low precision, especially on depthwise separable layers.   \r\n- Add the binary and ternary quantizers used in the bnn_pynq examples as standalone quantizers under brevitas.quant.","2021-05-06T09:41:53",{"id":249,"version":250,"summary_zh":251,"released_at":252},333368,"v0.4.0","Changelog:\r\n- Add support for \\_\\_torch_function\\_\\_ to QuantTensor for supported versions of PyTorch. This finally removes the main barrier in making usage of QuantTensor more ingrained into the overall library.\r\n- Correctly export operators that are invoked through \\_\\_torch_function\\_\\_ and that are invariant to quantization such as torch.nn.functional.max_pool2d in both standard ONNX and PyXIR.\r\n","2021-03-15T19:40:19"]