feat(streampetr): add auxiliary 2D head, partial-ignore, and DDP loss normalization - #5
Draft
vividf wants to merge 1 commit into
Draft
Conversation
vividf
force-pushed
the
feat/streampetr-aux-2d-head
branch
from
September 2, 2026 08:43
42434be to
a40d08b
Compare
vividf
force-pushed
the
feat/streampetr-2d-annotations
branch
from
September 2, 2026 08:43
6fc9075 to
f94c6cb
Compare
vividf
force-pushed
the
feat/streampetr-aux-2d-head
branch
from
September 2, 2026 08:57
a40d08b to
95a151c
Compare
vividf
force-pushed
the
feat/streampetr-2d-annotations
branch
2 times, most recently
from
September 2, 2026 09:31
262f7ee to
4e78b19
Compare
vividf
force-pushed
the
feat/streampetr-aux-2d-head
branch
from
September 2, 2026 09:31
95a151c to
7635f26
Compare
vividf
force-pushed
the
feat/streampetr-2d-annotations
branch
from
September 2, 2026 21:02
4e78b19 to
d6579bd
Compare
vividf
force-pushed
the
feat/streampetr-aux-2d-head
branch
from
September 2, 2026 21:02
7635f26 to
6065857
Compare
vividf
marked this pull request as draft
September 3, 2026 17:24
vividf
force-pushed
the
feat/streampetr-2d-annotations
branch
from
September 4, 2026 06:24
d6579bd to
7ae5816
Compare
vividf
force-pushed
the
feat/streampetr-aux-2d-head
branch
from
September 4, 2026 06:24
6065857 to
abdccfa
Compare
vividf
force-pushed
the
feat/streampetr-2d-annotations
branch
from
September 4, 2026 07:29
7ae5816 to
a750d87
Compare
vividf
force-pushed
the
feat/streampetr-aux-2d-head
branch
from
September 4, 2026 07:29
abdccfa to
7b21f5f
Compare
This was referenced Sep 4, 2026
… normalization Focal-PETR-style FocalHead2D supervising the image features during training, CPFPN as the reference neck, traffic_cone/barrier partial-ignore as classification-column weights shared by both heads, and cross-rank positive-count normalization (mmdetection reduce_mean) with real multi-process regression tests. Signed-off-by: vividf <yihsiang.fang@tier4.jp>
vividf
force-pushed
the
feat/streampetr-2d-annotations
branch
from
September 4, 2026 08:00
a750d87 to
2bdd538
Compare
vividf
force-pushed
the
feat/streampetr-aux-2d-head
branch
from
September 4, 2026 08:00
7b21f5f to
26158be
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The training-quality core of the stack: auxiliary 2D supervision, partial-ignore for sparsely annotated classes, and DDP-correct loss normalization.
Changes
FocalHead2D(models/detection3d/heads/focal2d.py): Focal-PETR-style dense head over the stride-16 neck features — per-token class scores, centerness, LTRB boxes, and projected 3D centers, supervised by quality focal, weighted L1, GIoU, center L1, and Gaussian-heatmap centerness losses. Cost/loss weights follow the reference recipe (2/5/2/10 + 1); the defaultHungarianAssigner2Dmirrors the same cost weights. Loss-only: inference and deployment never run it. The reference's top-k token pruning is intentionally not ported.CPFPN(models/common/necks/cp_fpn.py): the reference StreamPETR neck (1×1 laterals, nearest top-down, 3×3 refine on level 0), with mm-compatible parameter names.models/detection3d/partial_ignore.py):traffic_cone/barrierhandled purely as classification-column weights — on an un-annotated frame, every query/token drops only the ignored class columns. Structurally unable to perturb Hungarian matching, bbox targets, or the normalization factor. Both heads share one masking helper and the same semantics; missing or mismatched status flags raise instead of silently training the ignored classes as background.task_modules/streaming.py+ both heads): positive counts are averaged across ranks (mmdetection'sreduce_mean), so the sharded loss equals the single-batch equivalent regardless of GPU count. Every collective sits on a rank-uniform code path — a rank whose batch has no ground truth still participates in the DN count collective with a zero contribution, so mixed-GT steps cannot deadlock.Testing
Real multi-process gloo tests (
test_streampetr_loss_distributed.py): a sharding-invariance property test (DDP-averaged sharded loss == combined-batch loss), the mixed-GT deadlock regression, and reduce-mean semantics. Partial-ignore has unit tests down to exact masked rows/columns and an end-to-endhead.losswiring test.Stack 7/8 — base:
feat/streampetr-2d-annotations.