Skip to content

ops: in-house spconv export ops + TensorRT plugin build - #21

Draft
vividf wants to merge 1 commit into
pr10-centerpoint-onboardingfrom
pr11-spconv-trt-plugins
Draft

ops: in-house spconv export ops + TensorRT plugin build#21
vividf wants to merge 1 commit into
pr10-centerpoint-onboardingfrom
pr11-spconv-trt-plugins

Conversation

@vividf

@vividf vividf commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Stacked PR 11/15 — ⬅ #20 | #25

Stack(base pr-stack-base = 7e35d97):#11#12#13#14#15#16#17#18#19#20(CenterPoint 全功能點)→ #21#25#22#23#24(= 開發 branch HEAD,逐位元一致)。合併由下而上,每合一層把下一層 base retarget。

這個 PR 是什麼

Sparse 模型的前置基礎設施(永久,不屬 parking):自家 spconv export ops + ONNX fusion pass + TensorRT plugin 建置。BEVFusion 的 evaluation 要跑 sparse 圖、PTv3 的 CPE 走同一 plugin——所以放在兩者 onboarding(#25/#22/#23)之前、CenterPoint(不需要)之後。

逐檔導覽

  • ops/spconv/sparse_conv.py / sparse_functional.py:export 態的 sparse conv 形式(可被 torch.onnx.export 追蹤成 autoware:: 自訂 op 節點)。
  • ops/spconv/onnx_fusion.py:匯出後的圖重寫——把 bias/BN 殘餘/activation 摺進 plugin 節點屬性,使 runtime plugin 一顆 kernel 吃完(sparse 鏈實測 8.5→6.8 ms 的組成之一)。掛載點是 deploy: stage-graph foundation (GraphStage/TorchStage) + shared runtime utils #13GraphStage.onnx_transforms,但 pass 本身不依賴 deployment 模組(它先進 stack)。
  • docker/tensorrt_plugins/:libautoware_tensorrt_plugins.so 的建置(CMakeLists、build_plugin.sh、build_spconv_cpp.sh、README)。README 記了三個建置坑:pixi sysroot、ldconfig、sm_120。
  • docker/Dockerfile:plugin 建置層(BUILD_TENSORRT_PLUGINS ARG 可關;獨立 layer 不被專案 copy 失效)。
  • 測試:test_spconv_onnx_fusion(fusion pass 圖形斷言)、test_sparse_graph_contract(用 inspect 對 sparse_functional 做簽名契約測試——export 圖與 runtime plugin 的 ABI 對齊靠它守)。
檔案清單(點開)
autoware_ml/ops/spconv/onnx_fusion.py 161 +++++++++++++++++
autoware_ml/ops/spconv/sparse_conv.py 8 +
autoware_ml/ops/spconv/sparse_functional.py 41 ++++-
.../tests/deployment/test_spconv_onnx_fusion.py 125 +++++++++++++
docker/Dockerfile 25 +++
docker/tensorrt_plugins/CMakeLists.txt 149 +++++++++++++++
docker/tensorrt_plugins/README.md 71 ++++++++
docker/tensorrt_plugins/build_plugin.sh 201 +++++++++++++++++++++
docker/tensorrt_plugins/build_spconv_cpp.sh 66 +++++++

Review checklist

  • onnx_fusion 的節點比對邏輯(它假設的圖形狀在 export 形式變動時會不會靜默失配)。
  • 兩支 build 腳本的重疊段(sysroot/cmake 參數)——可議抽共用,不擋合入。
  • test_sparse_graph_contract 的 inspect 手法值不值得一段註解說明動機(ABI 對齊)。

🤖 Generated with Claude Code

Needed because BEVFusion evaluation runs the sparse graph through the
autoware:: plugin ops; permanent infrastructure, not part of the parking.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant