Skip to content

refactor(autoware_tensorrt_plugins): remove SegmentCSR nD indptr path#12739

Merged
mojomex merged 1 commit into
autowarefoundation:mainfrom
mojomex:refactor/trt-plugins-segmentcsr-1d-indptr
Jun 12, 2026
Merged

refactor(autoware_tensorrt_plugins): remove SegmentCSR nD indptr path#12739
mojomex merged 1 commit into
autowarefoundation:mainfrom
mojomex:refactor/trt-plugins-segmentcsr-1d-indptr

Conversation

@mojomex

@mojomex mojomex commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Third PR in the SegmentCSR split stack.

This PR removes the unreachable n-dimensional indptr launcher path. The TensorRT plugin already requires a 2D source tensor and 1D indptr, so the vector-shaped launcher, indptr_to_offset helper and bookkeeping are dead code.

Since the SegmentCSR plugin has been introduces for PTv3, which isn't using the nD case, and since there are no other users, removing seems like the best option.

Stack

  1. test(autoware_tensorrt_plugins): add SegmentCSR kernel tests #12740: add SegmentCSR kernel tests.
  2. refactor(autoware_tensorrt_plugins): clarify SegmentCSR contract #12741: document/clarify the contract and clean up in/out API names.
  3. This PR: remove the dead n-dimensional indptr path.
  4. perf(autoware_tensorrt_plugins): keep SegmentCSR allocation-free #12555: keep SegmentCSR allocation-free.

@mojomex mojomex force-pushed the refactor/trt-plugins-segmentcsr-1d-indptr branch 2 times, most recently from d52b627 to 5ac0683 Compare June 10, 2026 08:52
@mojomex mojomex changed the title refactor(autoware_tensorrt_plugins): restrict SegmentCSR to 1D indptr refactor(autoware_tensorrt_plugins): remove SegmentCSR nD indptr path Jun 10, 2026
@github-actions github-actions Bot added type:documentation Creating or refining documentation. (auto-assigned) component:perception Advanced sensor data processing and environment understanding. (auto-assigned) labels Jun 10, 2026
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@mojomex mojomex force-pushed the refactor/trt-plugins-segmentcsr-1d-indptr branch from 5ac0683 to b93af83 Compare June 10, 2026 09:25
@mojomex mojomex requested a review from manato June 10, 2026 09:30
@mojomex mojomex force-pushed the refactor/trt-plugins-segmentcsr-1d-indptr branch from 9eb3e10 to d603e63 Compare June 11, 2026 08:10
@mojomex mojomex marked this pull request as ready for review June 11, 2026 08:10
@github-actions github-actions Bot removed the type:documentation Creating or refining documentation. (auto-assigned) label Jun 11, 2026
@mojomex mojomex self-assigned this Jun 11, 2026
@mojomex mojomex added run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) tag:require-cuda-build-and-test labels Jun 11, 2026
@mojomex mojomex requested a review from Copilot June 11, 2026 08:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the SegmentCSR TensorRT plugin and its CUDA kernel launcher to remove the previously-unreachable n-dimensional indptr/size-vector code path, aligning the implementation with the plugin’s documented 2D src + 1D indptr contract.

Changes:

  • Simplifies segment_csr_launch API from std::vector<int32_t> size parameters to explicit (num_rows, num_cols, indptr_size) integers.
  • Removes nD indptr bookkeeping utilities (including indptr_to_offset) and related kernel indexing paths.
  • Updates plugin enqueue code and unit tests to use the new launcher signature.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
perception/autoware_tensorrt_plugins/test/segment_csr_kernel_test.cpp Updates kernel test calls to the new segment_csr_launch signature.
perception/autoware_tensorrt_plugins/src/segment_csr_plugin.cpp Updates plugin enqueue logic to pass (num_rows, num_cols, indptr_size) directly.
perception/autoware_tensorrt_plugins/src/scatter_ops/segment_csr.cu Removes nD launch path, simplifies kernels/launch signature, and deletes nD offset logic.
perception/autoware_tensorrt_plugins/include/autoware/scatter_ops/utils.cuh Removes the now-dead indptr_to_offset helper.
perception/autoware_tensorrt_plugins/include/autoware/scatter_ops/segment_csr.h Replaces vector-based API with scalar size args and adds/updates contract documentation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread perception/autoware_tensorrt_plugins/src/scatter_ops/segment_csr.cu
Comment thread perception/autoware_tensorrt_plugins/include/autoware/scatter_ops/segment_csr.h Outdated
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (54fa737) to head (0f14e0a).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main   #12739       +/-   ##
===========================================
- Coverage   19.58%    0.00%   -19.59%     
===========================================
  Files        1903       41     -1862     
  Lines      131340     1587   -129753     
  Branches    45785        0    -45785     
===========================================
- Hits        25718        0    -25718     
+ Misses      84661     1587    -83074     
+ Partials    20961        0    -20961     
Flag Coverage Δ
full-suite 0.00% <ø> (-19.59%) ⬇️

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Remove the unused n-dimensional indptr launcher path and offset helper now that the plugin contract is explicitly 1D.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Max SCHMELLER <max.schmeller@tier4.jp>
@mojomex mojomex force-pushed the refactor/trt-plugins-segmentcsr-1d-indptr branch from d603e63 to 0f14e0a Compare June 11, 2026 09:07
@mojomex mojomex requested a review from vividf June 12, 2026 00:50
@amadeuszsz

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 0f14e0a9b7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@amadeuszsz amadeuszsz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@mojomex mojomex merged commit ccee12e into autowarefoundation:main Jun 12, 2026
32 checks passed
@mojomex mojomex deleted the refactor/trt-plugins-segmentcsr-1d-indptr branch June 12, 2026 10:34
@github-project-automation github-project-automation Bot moved this from To Triage to Done in Software Working Group Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:perception Advanced sensor data processing and environment understanding. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) tag:require-cuda-build-and-test

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants