AGENT SKILL

ONNX Runtime 代码审查

code-review

审查 ONNX Runtime 的拉取请求(pull requests)、分支、提交、补丁和工作区变更,给出可操作的审查意见并指出缺失的测试。

License 许可
MIT
最近更新
2026-11-15
Stars
★ 2.2w
Forks
4.4k

01 前言 Front Matter

name
code-review
description
Review ONNX Runtime pull requests, branches, commits, patches, and working-tree changes for actionable findings and missing tests.

03 SKILL.md 正文

Reviewing ONNX Runtime Code Changes

Use this workflow for code review.

1. Establish the review scope

Determine the review base before analyzing the change. Identify the exact commits or working-tree state being reviewed, then enumerate all changed files.

If no changed files are found, respond with: "No changes detected. Please specify a commit range, branch, or patch to review."

Read every .github/instructions/**/*.instructions.md file whose applyTo scope matches a changed path. Also load each domain skill whose description matches the changed subsystem or behavior.

If no instructions file or domain skill matches a changed path, proceed using general ONNX Runtime and language-specific conventions.

2. Analyze changed behavior

Review the diff in context, including controlling code, relevant callers, and affected tests. Trace inputs through the changed behavior to externally visible results or failure modes.

Distinguish defects introduced by the change from pre-existing issues.

Ensure coverage of all the following:

  • correctness and security;
  • ABI and API compatibility;
  • memory safety and concurrency;
  • portability across supported platforms and configurations;
  • missing tests for behavior changed by the diff.

Also report actionable clarity and maintainability concerns, even when they are not correctness defects.

Do not report formatting issues already enforced by repository tooling.

3. Report findings

Report each actionable finding separately, using an inline comment when supported. Each finding must include:

  • the file and line where the finding applies;
  • concrete evidence or a triggering scenario;
  • the resulting impact;
  • an actionable correction.

If no actionable findings are found, say so explicitly.

04 同仓库更多 Skills

microsoft
microsoft/onnxruntime

工作空间估计共享头文件

workspace-estimation-shared-header

在编辑边界安全的共享头文件时使用,该头文件须同时被树内代码和共享提供者/插件桥接代码包含(例如 include/onnxruntime/core/framework/workspace_requirement.h,或任何未来支持 OrtKernelWorkspaceEstimateFunc / DeclareWorkspaceRequirements 的头文件,参见 issue #29775 的 Phase-A 工作空间估计路线图),或者当工作空间估计数学辅助函数需要从未来的插件 EP DLL 中调用时。涵盖 Node 前向声明的 ODR 陷阱,以及在实现 PR #29811(MatMulNBits 试点)时发现的数学辅助函数与图解析包装器之间的重用边界。

软件开发工程师C++ 开发
★ 2.2w
microsoft
microsoft/onnxruntime

ONNX Runtime WebGPU 本地测试

webgpu-local-testing

在没有真实 GPU 的 Linux 上构建并运行 ONNX Runtime WebGPU 提供者测试,使用软件 Vulkan 适配器(Mesa lavapipe)。当需要在非 Mac 环境下运行 WebGPU EP 内核时使用——Linux 的 webgpu CI 环节仅做构建,因此软件 Vulkan 是本地实际运行 WebGPU 正确性测试的方式。范围——lavapipe 仅能验证主机侧的 enforce/shape 缺陷以及不含 MatMul 的内核;任何包含 MatMul 的图(包括扩展的 Attention 节点测试)都会使 lavapipe 崩溃,此类测试仅在 macOS-arm64 Metal 上运行,Metal 是这些测试的权威来源。涵盖安装(在 Azure Linux 上用 dnf)、--use_webgpu 构建标志、onnxruntime_provider_test 目标、VK_ICD_FILENAMES,以及 lavapipe 的 MatMul 崩溃陷阱。

软件开发工程师开发环境与工具链管理
★ 2.2w
microsoft
microsoft/onnxruntime

Python setattr 安全审查

python-kwargs-setattr-security

在审查或修复 ONNX Runtime 中使用用户可控的 kwargs 通过 setattr() 配置 C++ 扩展对象(SessionOptions、RunOptions 等)的 Python 代码时使用。用于应用白名单模式,防止通过反射属性访问进行任意文件写入和其他攻击。

安全工程师安全检测工程
★ 2.2w
microsoft
microsoft/onnxruntime

ONNX Runtime Transformers GPU 测试

ort-transformers-gpu-pytest

针对 GPU wheel 运行 ONNX Runtime transformers Python 测试(onnxruntime/test/python/transformers),并确认真实的 cuDNN/flash SDPA 调度。当 transformers pytest 因 ModuleNotFoundError onnxruntime.capi 失败、torch 自带的 CUDA/cuDNN 库覆盖了 ORT 构建的库(导致错误版本调度或加载错误),或必须证明测试确实执行了 cuDNN SDPA 解码层而非静默跳过或回退到 MATH 时使用。

测试工程师测试与质量保障
★ 2.2w
microsoft
microsoft/onnxruntime

ONNX Runtime 测试执行与调试

ort-test

运行 ONNX Runtime 测试。当被要求运行测试、调试测试失败,或在 ONNX Runtime 中查找并执行特定测试用例时使用此技能。

测试工程师测试与质量保障
★ 2.2w
microsoft
microsoft/onnxruntime

ONNX Runtime 发布说明撰写

ort-release-notes

使用预设配置为完整 ORT 或限定范围的组件发布起草 ONNX Runtime 发布说明。适用于生成带 PR 链接的亮点摘要、根据 compile_contributors.py 的输出整理人工贡献者致谢名单,以及应用预设的路径过滤。

技术文档工程师部署与发布管理
★ 2.2w