Skip to content

[CI] remove TensorRT from PaddleTest#3241

Open
gouzil wants to merge 5 commits into
PaddlePaddle:developfrom
gouzil:codex/retire-tensorrt-tests
Open

[CI] remove TensorRT from PaddleTest#3241
gouzil wants to merge 5 commits into
PaddlePaddle:developfrom
gouzil:codex/retire-tensorrt-tests

Conversation

@gouzil

@gouzil gouzil commented Jul 14, 2026

Copy link
Copy Markdown
Member

关联 PR

Paddle PR #79444 将 TensorRT 从默认 CI 构建和必测链路中退场,并明确把 PaddleTest 中 TRT 能力的清理留给本仓库处理。本 PR 不再局限于删除失败 case 或停止调度,而是从 PaddleTest 中完整删除 TRT 专用的测试、执行和配置能力。

变更内容

  • 删除 TRT 专用测试、runner、INT8 backend、调度入口和相关辅助代码。
  • 删除 TRT 链路移除后不再具有独立测试意义的单测文件;仍有普通 GPU、CPU、MKLDNN、配置、前向或反向覆盖的测试继续保留。
  • 删除 Jetson TensorRT benchmark,以及 Paddle、TensorFlow、PyTorch benchmark 中的 TRT 实现、命令行参数和调度命令。
  • 删除 Paddle2ONNX 中的 TensorRT 推理路径,以及 AutomaticTestSystem、PaddleDetection、PaddleMIX、PaddleVideo、PaddleNLP 等项目中的 TRT case 和执行分支。
  • 删除 YAML 模板与 workflow 中的 TRT case、CLI 参数、环境变量、专用依赖、安装步骤、报表字段和数据库历史字段。
  • 清理删除链路后产生的无调用方代码,保留与 TRT 无关的普通推理和测试路径。

清理结果

  • PR 共涉及 620 个文件:删除 93 个文件,修改 527 个文件,共 153 行新增、22,922 行删除。
  • TensorRT/TRT 的功能语义扫描结果为 0:仓库中不再保留 TRT API、参数、backend、case、调度或运行入口。
  • 宽泛搜索仍有 15 个文件中的 89 处 trt 子串,仅来自已发布的共享 Docker 镜像、wheel/预测库制品名称,以及 PETRTransformer 标识;这些内容不构成 PaddleTest 的 TRT 功能入口或配置能力。

验证

  • 77 个变更 Python 文件通过 py_compile
  • 37 个变更 Shell 文件通过 bash -n
  • 404 个变更 YAML 中,401 个可正常解析;其余 3 个文件在 develop 基线中已存在不可解析状态,本 PR 未新增 YAML 解析回归。
  • TRT 功能语义残留扫描为 0。
  • git diff --check 通过。
  • 当前 GitHub 检查中 license/cla 已通过。

未运行依赖 GPU 的全量端到端测试;本 PR 的目标是删除 PaddleTest 中的 TRT 测试及执行能力,不修改 Paddle 仓库内的 TensorRT 产品实现。

@gouzil gouzil changed the title [codex] retire TensorRT tests [CI] retire TensorRT tests Jul 14, 2026
@gouzil
gouzil marked this pull request as ready for review July 14, 2026 14:49
Copilot AI review requested due to automatic review settings July 14, 2026 14:49
Copilot stopped reviewing on behalf of gouzil due to an error July 14, 2026 15:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@gouzil gouzil changed the title [CI] retire TensorRT tests [CI] remove TensorRT from PaddleTest Jul 19, 2026

@ShigureNyako ShigureNyako left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

结论:当前 head 068e7ff97b2e704a85c91759c3d98f9ce71b1155 仍需修改。

本轮有两处阻塞项:删除 Serving 的禁用态兼容参数会破坏普通 CPU/GPU 用例;删除混合参数化的 OCR 测试时一并丢失了普通 GPU 预测覆盖。细节见行级评论。

聚焦静态验证通过:77 个变更 Python 文件 py_compile、37 个变更 Shell 文件 bash -ngit diff --check;404 个变更 YAML 用 PyYAML safe_load 为 401 个通过、3 个失败,3 个在基线同样失败。当前 GitHub 仅有 license/cla 成功,没有执行测试结果可覆盖上述回归。

args.max_body_size = 512 * 1024 * 1024
args.use_encryption_model = False
args.use_multilang = False
args.use_trt = False

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不能删除 args.use_trt:它不是 TRT case,而是调用未同步修改的 paddle_serving_server.serve.start_gpu_card_model 所需的兼容参数。当前 test_serve.py:96,105,133,163 都先取 default_args() 再调用该函数;Serving 实现仍会直接读取 args.use_trt。删掉后普通 CPU/GPU Serving 用例会在启动前因 AttributeError 失败。请保留这个 False 默认值;它只表示不启用 TRT。

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

复查当前 head 6e2a8f183ee7afc6ee80b9d47049f1908ea0c29d:本次提交仅修改 models/AutomaticTestSystem/test_ocr_acc.py,这里的 default_args() 仍未恢复 args.use_trt = False,因此该兼容性 blocker 仍然存在。

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已复查当前 head 00d233c5d532314866b2ab1291fb75cb822469ed:本次提交原样恢复 args.use_trt = False;实际加载 default_args() 验证该属性存在且为 False。Serving 兼容性问题已解决。

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在这里修不是最终解决方法,Serving 也应该做 trt 退场,不过那是后续的事了


@allure.story("predict")
@pytest.mark.parametrize("yml_name", get_model_list())
@pytest.mark.parametrize("use_tensorrt", [True, False])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个参数化测试不全是 TRT 覆盖:use_tensorrt=False 分支会标记为 _GPU,并在原 test_ocr_acc.py:202use_gpu=True, use_tensorrt=False 执行普通 GPU 预测。当前 head 只剩 test_ocr_acc.py:177use_gpu=False CPU/MKLDNN 调用,AutomaticTestSystem 中已没有普通 OCR GPU 预测入口。请保留或拆出 GPU-only 分支,只删除 use_tensorrt=True 的覆盖。

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已复查当前 head 6e2a8f183ee7afc6ee80b9d47049f1908ea0c29d:新增 test_ocr_accuracy_predict_gpu,并以 test_ocr_rec_predict(True, False) 恢复普通 GPU、TRT 关闭态的预测覆盖;该文件 py_compile 与本次提交 git diff --check 均通过。此项已解决。

@ShigureNyako ShigureNyako left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

结论:当前 head 6e2a8f183ee7afc6ee80b9d47049f1908ea0c29d 仍需修改。

本次提交仅修改 models/AutomaticTestSystem/test_ocr_acc.py:新增 GPU-only 用例并调用 test_ocr_rec_predict(True, False),已恢复普通 GPU、TRT 关闭态的预测覆盖;该项已在原线程确认解决。

Serving blocker 未处理:inference/serving_api_test/paddle_serving_server/util.py 仍缺少 args.use_trt = False,而未同步修改的 start_gpu_card_model 仍直接读取该参数。已在原线程补充当前 head 证据,不重复新增行级评论。

本次增量验证:新增 Python 文件改动通过 py_compile068e7ff..6e2a8f1 通过 git diff --check。当前 GitHub 仍只有 license/cla 成功,没有执行测试结果。

@ShigureNyako ShigureNyako left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMeow 🐾

已复查当前 head 00d233c5d532314866b2ab1291fb75cb822469ed,此前两个 blocker 均已解决:

  • Serving fixture 已恢复 args.use_trt = False;实际调用 default_args() 验证该兼容属性存在且保持禁用。
  • OCR GPU-only 用例仍以 test_ocr_rec_predict(True, False) 保留普通 GPU、TRT 关闭态覆盖。

本次增量仅恢复一行 Serving 默认参数,无新范围。全量静态复核通过:76 个变更 Python 文件 py_compile、37 个变更 Shell 文件 bash -ngit diff --check;404 个变更 YAML 为 401 个通过、3 个与基线相同的既有失败。当前 GitHub 仅有 license/cla 成功,没有执行型 CI;仓库未配置 required checks,当前 merge state 为 clean。

代码审查结论:批准。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants