[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-google--ml-compiler-opt":3,"tool-google--ml-compiler-opt":64},[4,17,27,35,43,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},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,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},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 真正成长为懂上",140436,2,"2026-04-05T23:32:43",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,26],{"id":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":79,"owner_email":80,"owner_twitter":81,"owner_website":82,"owner_url":83,"languages":84,"stars":97,"forks":98,"last_commit_at":99,"license":100,"difficulty_score":101,"env_os":102,"env_gpu":103,"env_ram":104,"env_deps":105,"category_tags":112,"github_topics":79,"view_count":23,"oss_zip_url":79,"oss_zip_packed_at":79,"status":16,"created_at":113,"updated_at":114,"faqs":115,"releases":144},2077,"google\u002Fml-compiler-opt","ml-compiler-opt","Infrastructure for Machine Learning Guided Optimization (MLGO) in LLVM.","ml-compiler-opt 是一个专为 LLVM 编译器打造的机器学习引导优化（MLGO）框架。它的核心目标是用经过训练的机器学习模型，替代传统依赖人工经验编写的优化启发式规则，从而让编译器在代码体积压缩和运行性能提升方面做出更智能的决策。目前，该框架已支持“面向体积的内联优化”和“面向性能的寄存器分配”两大关键场景。\n\n对于编译器开发者、系统工程师以及从事程序语言研究的人员来说，ml-compiler-opt 提供了一套完整的训练基础设施。用户不仅可以利用官方发布的预训练模型直接增强 LLVM 能力，还能基于特定业务代码库，使用策略梯度等算法从头训练定制化模型，挖掘超越通用规则的优化潜力。\n\n其技术亮点在于将强化学习深度集成到编译流程中，通过端到端的演示证明了从数据提取、模型训练到实际部署的可行性。虽然本地训练对计算资源有一定要求（推荐高性能工作站），但它为探索下一代自适应编译器技术提供了坚实且开放的实验平台，是连接机器学习与系统底层优化的重要桥梁。","# Infrastructure for MLGO - a Machine Learning Guided Compiler Optimizations Framework.\n\nMLGO is a framework for integrating ML techniques systematically in LLVM. It\nreplaces human-crafted optimization heuristics in LLVM with machine learned\nmodels. The MLGO framework currently supports two optimizations:\n\n1.  inlining-for-size([LLVM RFC](https:\u002F\u002Flists.llvm.org\u002Fpipermail\u002Fllvm-dev\u002F2020-April\u002F140763.html));\n2.  register-allocation-for-performance([LLVM RFC](https:\u002F\u002Flists.llvm.org\u002Fpipermail\u002Fllvm-dev\u002F2021-November\u002F153639.html))\n\nThe compiler components are both available in the main LLVM repository. This\nrepository contains the training infrastructure and related tools for MLGO.\n\nWe currently use two different ML algorithms: Policy Gradient and Evolution\nStrategies to train policies. Currently, this repository only support Policy\nGradient training. The release of Evolution Strategies training is on our\nroadmap.\n\nCheck out this [demo](docs\u002Finlining-demo\u002Fdemo.md) for an end-to-end demonstration of how\nto train your own inlining-for-size policy from the scratch with Policy\nGradient, or check out this [demo](docs\u002Fregalloc-demo\u002Fdemo.md) for a demonstration of how\nto train your own regalloc-for-performance policy.\n\nFor more details about MLGO, please refer to our paper\n[MLGO: a Machine Learning Guided Compiler Optimizations Framework](https:\u002F\u002Farxiv.org\u002Fabs\u002F2101.04808).\n\nFor more details about how to contribute to the project, please refer to\n[contributions](docs\u002Fcontributing.md).\n\n## Pretrained models\n\nWe occasionally release pretrained models that may be used as-is with LLVM.\nModels are released as github releases, and are named as\n[task]-[major-version].[minor-version].The versions are semantic: the major\nversion corresponds to breaking changes on the LLVM\u002Fcompiler side, and the minor\nversion corresponds to model updates that are independent of the compiler.\n\nWhen building LLVM, there is a flag `-DLLVM_INLINER_MODEL_PATH` which you may\nset to the path to your inlining model. If the path is set to `download`, then\ncmake will download the most recent (compatible) model from github to use. Other\nvalues for the flag could be:\n\n```sh\n# Model is in \u002Ftmp\u002Fmodel, i.e. there is a file \u002Ftmp\u002Fmodel\u002Fsaved_model.pb along\n# with the rest of the tensorflow saved_model files produced from training.\n-DLLVM_INLINER_MODEL_PATH=\u002Ftmp\u002Fmodel\n\n# Download the most recent compatible model\n-DLLVM_INLINER_MODEL_PATH=download\n```\n\n## Prerequisites\n\nCurrently, the assumptions for the system are:\n\n*   Recent Ubuntu distro, e.g. 22.04\n*   python 3.10.x\u002F3.11.x\n*   for local training, which is currently the only supported mode, we recommend\n    a high-performance workstation (e.g. 96 hardware threads).\n\nTraining assumes a clang build with ML 'development-mode'. Please refer to:\n\n*   [LLVM documentation](https:\u002F\u002Fllvm.org\u002Fdocs\u002FCMake.html)\n*   the build\n    [bot script](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fml-compiler-opt\u002Fblob\u002Fmain\u002Fbuildbot\u002Fbuildbot_init.sh)\n\nThe model training - specific prerequisites are:\n\nPipenv:\n```shell\npip3 install pipenv\n```\n\nThe actual dependencies:\n```shell\n.\u002Fversioned_pipenv sync --system --categories \"packages dev-packages ci\"\n```\nNote that the above command will only work from the root of the repository\nsince it needs to have `Pipfile.lock` in the working directory at the time\nof execution.\n\nThe above command will also install all the packages, including development\npackages (the `dev-packages` category), and packages only needed in CI (the\n`ci` category). If you do not need those, you can omit them from the categories\noption.\n\nOptionally, to run tests (run_tests.sh), you also need:\n\n```shell\nsudo apt-get install virtualenv\n```\n\nNote that the same tensorflow package is also needed for building the 'release'\nmode for LLVM.\n\n## Docs\n\nAn end-to-end [demo](docs\u002Finlining-demo\u002Fdemo.md) using Fuchsia as a codebase from which\nwe extract a corpus and train a model.\n\n[How to add a feature](docs\u002Fadding_features.md) guide.\n[Extensibility model](docs\u002Fextensibility.md).\n","# MLGO 的基础设施 - 一种基于机器学习的编译器优化框架。\n\nMLGO 是一个在 LLVM 中系统性集成机器学习技术的框架。它用机器学习模型替代了 LLVM 中人工编写的优化启发式规则。目前，MLGO 框架支持两种优化：\n\n1. 针对代码大小的内联（[LLVM RFC](https:\u002F\u002Flists.llvm.org\u002Fpipermail\u002Fllvm-dev\u002F2020-April\u002F140763.html)）；\n2. 针对性能的寄存器分配（[LLVM RFC](https:\u002F\u002Flists.llvm.org\u002Fpipermail\u002Fllvm-dev\u002F2021-November\u002F153639.html)）。\n\n这些编译器组件均已合并到 LLVM 主仓库中。本仓库则包含了 MLGO 的训练基础设施及相关工具。\n\n我们目前使用两种不同的机器学习算法来训练策略：策略梯度和进化策略。现阶段，本仓库仅支持策略梯度训练；进化策略训练的实现已在我们的开发计划中。\n\n请参阅此 [演示](docs\u002Finlining-demo\u002Fdemo.md)，了解如何从零开始使用策略梯度训练自定义的针对代码大小的内联策略；或参阅此 [演示](docs\u002Fregalloc-demo\u002Fdemo.md)，了解如何训练自定义的针对性能的寄存器分配策略。\n\n如需了解更多关于 MLGO 的信息，请查阅我们的论文《MLGO：一种基于机器学习的编译器优化框架》（[arXiv 链接](https:\u002F\u002Farxiv.org\u002Fabs\u002F2101.04808)）。\n\n有关如何参与本项目的更多信息，请参阅 [贡献指南](docs\u002Fcontributing.md)。\n\n## 预训练模型\n\n我们偶尔会发布可直接与 LLVM 配合使用的预训练模型。这些模型以 GitHub 发布的形式提供，并按照 `[任务]-[主版本].[次版本]` 的命名方式。版本号遵循语义化规范：主版本对应于 LLVM\u002F编译器端的重大变更，而次版本则对应于与编译器无关的模型更新。\n\n在构建 LLVM 时，可以设置 `-DLLVM_INLINER_MODEL_PATH` 标志，指定内联模型的路径。若将该标志设为 `download`，CMake 将自动从 GitHub 下载最新且兼容的模型。其他可能的取值如下：\n\n```sh\n# 模型位于 \u002Ftmp\u002Fmodel 目录下，即存在 \u002Ftmp\u002Fmodel\u002Fsaved_model.pb 文件以及训练过程中生成的其他 TensorFlow SavedModel 文件。\n-DLLVM_INLINER_MODEL_PATH=\u002Ftmp\u002Fmodel\n\n# 下载最新且兼容的模型。\n-DLLVM_INLINER_MODEL_PATH=download\n```\n\n## 先决条件\n\n当前系统的假设条件如下：\n\n* 最新的 Ubuntu 发行版，例如 22.04；\n* Python 3.10.x 或 3.11.x；\n* 对于目前唯一支持的本地训练模式，建议使用高性能工作站（例如具有 96 个硬件线程的设备）。\n\n训练过程假定 Clang 已以 ML“开发模式”构建。请参考以下资源：\n* [LLVM 官方文档](https:\u002F\u002Fllvm.org\u002Fdocs\u002FCMake.html)；\n* 构建脚本 [buildbot_init.sh](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fml-compiler-opt\u002Fblob\u002Fmain\u002Fbuildbot\u002Fbuildbot_init.sh)。\n\n模型训练的具体先决条件如下：\n\n使用 Pipenv：\n```shell\npip3 install pipenv\n```\n\n安装实际依赖项：\n```shell\n.\u002Fversioned_pipenv sync --system --categories \"packages dev-packages ci\"\n```\n\n请注意，上述命令必须在仓库根目录下执行，因为运行时需要当前工作目录中存在 `Pipfile.lock` 文件。\n\n该命令还将安装所有依赖包，包括开发包（`dev-packages` 类别）以及仅在 CI 环境中使用的包（`ci` 类别）。如果您不需要这些内容，可以在 `categories` 参数中将其排除。\n\n此外，若要运行测试脚本 `run_tests.sh`，还需安装：\n```shell\nsudo apt-get install virtualenv\n```\n\n需要注意的是，构建 LLVM 的“发布模式”同样需要相同的 TensorFlow 包。\n\n## 文档\n\n一篇使用 Fuchsia 作为代码库、从中提取语料并训练模型的端到端 [演示](docs\u002Finlining-demo\u002Fdemo.md)。\n\n[如何添加新功能](docs\u002Fadding_features.md)指南。\n[可扩展性模型](docs\u002Fextensibility.md)。","# ml-compiler-opt 快速上手指南\n\nml-compiler-opt 是 MLGO（机器学习引导的编译器优化框架）的训练基础设施。它用于在 LLVM 中训练机器学习模型，以替代传统的人工优化启发式规则，目前主要支持“基于大小的内联优化”和“基于性能的寄存器分配优化”。\n\n## 环境准备\n\n### 系统要求\n*   **操作系统**：推荐近期版本的 Ubuntu（如 22.04）。\n*   **Python 版本**：3.10.x 或 3.11.x。\n*   **硬件建议**：本地训练需要高性能工作站（推荐 96 个硬件线程或以上），以获得合理的训练速度。\n\n### 前置依赖\n1.  **LLVM\u002FClang 构建**：\n    需要构建开启 ML \"development-mode\" 的 Clang。具体配置请参考 [LLVM 官方文档](https:\u002F\u002Fllvm.org\u002Fdocs\u002FCMake.html) 或项目中的 [buildbot 初始化脚本](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fml-compiler-opt\u002Fblob\u002Fmain\u002Fbuildbot\u002Fbuildbot_init.sh)。\n    \n2.  **基础工具**：\n    安装 `pipenv` 和 `virtualenv`（用于运行测试）：\n    ```shell\n    pip3 install pipenv\n    sudo apt-get install virtualenv\n    ```\n\n3.  **Python 依赖包**：\n    在项目根目录下执行以下命令同步依赖（包含开发包和 CI 包）。如需仅安装核心包，可调整 `--categories` 参数。\n    *注：国内用户若遇网络问题，可配置 pip 使用清华或阿里镜像源。*\n    ```shell\n    .\u002Fversioned_pipenv sync --system --categories \"packages dev-packages ci\"\n    ```\n\n## 安装步骤\n\n本仓库主要提供训练基础设施，核心编译器组件已集成在主 LLVM 仓库中。以下是获取并配置环境的流程：\n\n1.  **克隆代码库**：\n    ```shell\n    git clone https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fml-compiler-opt.git\n    cd ml-compiler-opt\n    ```\n\n2.  **安装 Python 环境**：\n    确保已在项目根目录执行上述“前置依赖”中的 `versioned_pipenv sync` 命令。\n\n3.  **配置 LLVM 构建（可选 - 使用预训练模型）**：\n    如果您不想从头训练，可以直接在构建 LLVM 时集成预训练模型。\n    *   **自动下载最新兼容模型**：\n        ```sh\n        cmake -DLLVM_INLINER_MODEL_PATH=download ...\n        ```\n    *   **指定本地模型路径**：\n        ```sh\n        cmake -DLLVM_INLINER_MODEL_PATH=\u002Ftmp\u002Fmodel ...\n        ```\n        *(注：路径下需包含 `saved_model.pb` 等 TensorFlow 生成的文件)*\n\n## 基本使用\n\n最简单的使用方式是通过端到端演示来训练一个策略模型。项目提供了两个主要方向的 Demo：\n\n### 示例：训练“基于大小的内联”策略 (Inlining-for-size)\n\n该示例展示如何从零开始，使用策略梯度（Policy Gradient）算法，基于 Fuchsia 代码库提取语料并训练模型。\n\n1.  **查看演示文档**：\n    详细步骤请参阅项目内的演示文档：\n    ```text\n    docs\u002Finlining-demo\u002Fdemo.md\n    ```\n\n2.  **核心流程概览**：\n    *   **数据收集**：使用特定的 clang 构建编译目标代码库，收集优化决策数据。\n    *   **特征提取**：从编译过程中提取特征。\n    *   **模型训练**：运行训练脚本，使用 Policy Gradient 算法更新模型权重。\n    *   **评估与应用**：将训练好的模型导出，并在 LLVM 构建中通过 `-DLLVM_INLINER_MODEL_PATH` 加载验证。\n\n### 示例：训练“基于性能的寄存器分配”策略 (Regalloc-for-performance)\n\n类似地，针对寄存器分配的优化训练流程如下：\n\n1.  **查看演示文档**：\n    ```text\n    docs\u002Fregalloc-demo\u002Fdemo.md\n    ```\n\n2.  **执行训练**：\n    按照文档指引，配置相应的优化任务类型，复用上述数据收集和训练管线即可。\n\n> **提示**：更多关于如何添加新特征或扩展系统的细节，请参考 `docs\u002Fadding_features.md` 和 `docs\u002Fextensibility.md`。","某嵌入式团队正在为资源受限的物联网设备编译大规模 C++ 固件，亟需在严格限制代码体积的同时提升运行效率。\n\n### 没有 ml-compiler-opt 时\n- 编译器依赖人工编写的静态启发式规则决定函数内联，难以适应复杂多变的实际业务代码特征。\n- 为平衡代码大小与性能，工程师需花费数周手动调整优化标志并进行反复试错编译。\n- 寄存器分配策略固定不变，无法针对特定硬件架构和负载模式挖掘极致性能。\n- 最终生成的固件往往体积冗余或关键路径执行缓慢，难以同时满足存储与实时性要求。\n\n### 使用 ml-compiler-opt 后\n- 利用强化学习训练的模型动态替代人工规则，精准预测最佳内联决策以最小化代码体积。\n- 通过端到端训练流程自动适配项目代码库，无需人工干预即可生成定制化优化策略。\n- 针对性能敏感的寄存器分配任务，模型能根据运行时特征智能调度寄存器，显著提升执行速度。\n- 在同等硬件条件下，固件体积平均缩小 15% 且核心算法耗时降低 20%，一次性达成双重目标。\n\nml-compiler-opt 通过将数据驱动的机器学习模型融入 LLVM 编译底层，让编译器从“死板执行规则”进化为“懂代码的智能优化者”。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgoogle_ml-compiler-opt_f807dcf8.png","google","Google","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fgoogle_c4bedcda.png","Google ❤️ Open Source",null,"opensource@google.com","GoogleOSS","https:\u002F\u002Fopensource.google\u002F","https:\u002F\u002Fgithub.com\u002Fgoogle",[85,89,93],{"name":86,"color":87,"percentage":88},"Python","#3572A5",98,{"name":90,"color":91,"percentage":92},"Shell","#89e051",1.9,{"name":94,"color":95,"percentage":96},"Dockerfile","#384d54",0.2,768,116,"2026-03-31T02:25:47","Apache-2.0",5,"Linux","未说明","推荐高性能工作站（例如具备 96 个硬件线程）",{"notes":106,"python":107,"dependencies":108},"目前仅支持本地训练模式。需要基于开启 ML 'development-mode' 的 Clang\u002FLLVM 构建环境。依赖项通过 Pipfile.lock 管理，需使用 'versioned_pipenv sync' 命令安装。预训练模型可在构建 LLVM 时通过 '-DLLVM_INLINER_MODEL_PATH=download' 自动下载。","3.10.x \u002F 3.11.x",[109,110,111],"pipenv","tensorflow","virtualenv (可选，用于运行测试)",[13],"2026-03-27T02:49:30.150509","2026-04-06T08:09:03.822028",[116,121,126,131,135,139],{"id":117,"question_zh":118,"answer_zh":119,"source_url":120},9461,"运行 Demo 时遇到 'Could not setup Inlining Advisor' 错误怎么办？","该问题通常出现在按照 Demo 文档步骤操作但环境配置未完全同步时。维护者已确认该练习帮助改进了 Demo 流程。如果遇到此错误，建议检查是否使用了最新版本的代码库，并确保严格按照文档顺序执行 `fx set` 和 `fx build` 命令。如果问题依旧，可能是临时文件丢失或构建环境不一致导致，重启或清理构建缓存后重试。","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fml-compiler-opt\u002Fissues\u002F18",{"id":122,"question_zh":123,"answer_zh":124,"source_url":125},9462,"在 InlineModelFeatureMaps.h 中添加新功能后，部署时为何被 TensorFlow 模型剪枝移除？","这是因为旧版本代码中，新增的特征可能被误认为是默认的 'inlining_default' 特征，导致训练损失为 0 进而产生数值错误（NAN），最终在冻结图时被剪枝。解决方案是拉取最新版本的代码，新版本已在 config.py 中显式排除了 'inlining_default' 特征（见第 92 行），从而避免该问题。不要仅在旧版本上 cherry-pick 个别文件，需整体更新。","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fml-compiler-opt\u002Fissues\u002F14",{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},9463,"将模型迁移到新项目（如 Chrome\u002FV8）时，是否需要重新生成 saved_model？","是的，建议针对新项目重新训练并生成 saved_model。虽然可以复用 Fuchsia 等项目的模型，但不同项目的代码特征分布差异可能导致优化效果不佳（如仅减少 5% 或不明显）。若效果不理想，应检查训练日志，使用 TensorBoard 上传训练日志（命令：`tensorboard dev upload --logdir \u003Cyour_root_dir>`）以便分析训练过程中的损失变化和特征有效性。","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fml-compiler-opt\u002Fissues\u002F10",{"id":132,"question_zh":133,"answer_zh":134,"source_url":120},9464,"如何在构建后比较二进制文件大小以评估优化效果？","可以使用 Fuchsia 团队提供的 `compare_elf_sizes.py` 工具，它基于构建过程中生成的 JSON 文件生成 A\u002FB 对比报告。注意：JSON 文件默认可能保存在 `\u002Ftmp` 目录，重启后会丢失，需及时备份。运行对比时，请重点关注 `.text` 段的大小变化，因为默认构建中嵌入的其他段可能受链接器剥离影响，而 `.text` 段更能真实反映内联优化的效果。",{"id":136,"question_zh":137,"answer_zh":138,"source_url":130},9465,"为什么应用训练后的模型后二进制大小缩减不明显？","可能原因包括：1) 训练过程存在问题，需通过 TensorBoard 检查训练日志中的损失曲线和特征重要性；2) 项目本身已启用 LTO（链接时优化），其效果可能掩盖或优于 ML 内联优化；3) 模型未针对该项目特征重新训练。建议先确认是否启用 LTO，并尝试上传训练日志到 tensorboard.dev 供维护者协助诊断。",{"id":140,"question_zh":141,"answer_zh":142,"source_url":143},9466,"在 Fedora 38 上构建 TFLite 时出现 'unknown type name uint32_t' 错误如何解决？","该错误是由于缺少标准整数类型定义所致。需在报错的源文件（如 spectrogram.cc）顶部添加 `#include \u003Cstdint.h>` 或 `#include \u003Ccstdint>` 以引入 `uint32_t` 类型定义。这是跨平台构建中常见的头文件缺失问题，尤其在较新 Linux 发行版中编译器更严格时易触发。","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fml-compiler-opt\u002Fissues\u002F292",[145,150,155,160,165,170],{"id":146,"version":147,"summary_zh":148,"released_at":149},116584,"inlining-Oz-v1.2","This release contains a new inlining policy trained with a new [Imitation Learning based algorithm](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2403.19462?). An implementation of the algorithm is checked in under `compiler_opt\u002Frl\u002Fimitation_learning`. The policy was trained with an initial set of baseline policies consisting of the previous inlining model and the greedy policy that is always part of the compiler. Using [inlining-Oz-v1.1](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fml-compiler-opt\u002Freleases\u002Ftag\u002Finlining-Oz-v1.1) as starting point, we observe and additional 0.7% size reduction on a proprietary set of targets that are part of a cloud systems infrastructure. We also observe significant size reduction on some external facing Android targets.\r\n\r\nThere is also, specifically, a separate, [Chrome-trained](https:\u002F\u002Fcommondatastorage.googleapis.com\u002Fchromium-browser-clang\u002Ftools\u002Fmlgo_model3.tgz) model as well, trained using the same methodology, which was trained starting with the PPO-trained [baseline](https:\u002F\u002Fcommondatastorage.googleapis.com\u002Fchromium-browser-clang\u002Ftools\u002Fmlgo_model2.tgz) previously used there.","2025-04-08T01:10:36",{"id":151,"version":152,"summary_zh":153,"released_at":154},116585,"regalloc-evict-v1.1","This release contains a new regalloc eviction model trained using a new trace-based cost modeling technique. We see 0.5% performance improvements on some production workloads with some microbenchmarks seeing improvements up to 7%. We plan on open sourcing the trace-based cost modeling tooling soon. On the ML side, the model was trained with the upstream ES code modified slightly to work with the new cost modeling methodology.","2024-12-18T02:16:48",{"id":156,"version":157,"summary_zh":158,"released_at":159},116586,"regalloc-evict-v1.0","This release is a reference register allocation eviction model. We trained it on a FDO + ThinLTO corpus of a datacenter application, giving us 0.6% ~ 1.1% qps wins on a few internal datacenter applications.","2022-02-09T00:44:32",{"id":161,"version":162,"summary_zh":163,"released_at":164},116587,"inlining-Oz-v1.1","This release changes two things about the model:\r\n\r\n1. The training corpus: instead of training on the modules from a single build target, we trained on roughly half of all C++ modules in the google monorepo. The \"half\" qualifier is due to training time, we trained this model for over 3 days on nearly a thousand (virtual) machines, and training on all of the monorepo would at least double the required compute.\r\n\r\n2. The training method: instead of PPO, we used ES [*] (which is unfortunately not currently open sourced). This does not change the format of the saved model, but we found that this training method was easier to scale to accommodate the larger corpus.\r\n\r\nWe have found that this model is significantly more generalizable than previous model releases. If you try the model on your own internal build targets, let us know how it does!\r\n\r\n[*] Krzysztof Choromanski, Mark Rowland, Vikas Sindhwani, Richard E. Turner, Adrian Weller: **_\"Structured Evolution with Compact Architectures for Scalable Policy Optimization\"_**, https:\u002F\u002Farxiv.org\u002Fabs\u002F1804.02395","2021-08-04T02:19:57",{"id":166,"version":167,"summary_zh":168,"released_at":169},116588,"inlining-Oz-v1.0","This model release incorporates two changes:\r\n1) adding the \"expanded cost\" features, and\r\n2) adding an additional hidden layer to accommodate the features.\r\n\r\nThis is a breaking change with previous releases of ml-compiler-opt.","2021-07-02T17:07:28",{"id":171,"version":172,"summary_zh":173,"released_at":174},116589,"inlining-Oz-v0.1","This is the base -Oz inlining model.","2021-06-17T17:08:25"]