File size: 2,091 Bytes
2230fab
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# SPDX-License-Identifier: Apache-2.0
"""CPU reference of CenterPoint (Autoware lidar_centerpoint) -- the ground truth every PCC / output-agreement gate
compares against (PLAN.md 0.3 item 1). It runs where ttnn is absent (the research venv) and never imports ttnn.

- ``config.py``    the Autoware parameters this port reproduces (ml_package / class remapper yaml of the weights,
                   ``centerpoint_common.param.yaml``) and the COMPILE constants, each with its source line;
- ``weights.py``   the two deployed ONNX graphs read as data with the vendored ``ttaw.weights.OnnxWeights``
                   (initializers by consuming node; structure from the graph topology; BN folded in float64 where
                   the TT port folds it: PFN MatMuls, deblock ConvTransposes);
- ``model.py``     fp32 torch rebuild of the deployed graph (PFN, scatter, SECOND, SECONDFPN, CenterHead) with
                   per-module taps (``ttaw.golden.TapRegistry``; names in ``MODULE_TAPS``);
- ``rewrites.py``  the TT-friendly equivalent forms (split PFN, K-split shared conv, merged heads, ConvTranspose as
                   linear + depth-to-space), proven against ``model.py`` on the CPU;
- ``ort.py``       ONNX Runtime golden of the shipped ONNX as Autoware binds it (40,000-pillar encoder input), with
                   optional module intermediates (research / tests only: onnxruntime is not in the image);
- ``pipeline.py``  the reference end to end: ``host/`` pre-processing -> torch or ORT network -> ``host/``
                   post-processing -> ``ttaw.outputs.Detections3D``.

Pre- and post-processing are not duplicated here: they live in ``tt_centerpoint.host`` (shared with the device path,
so TT and CPU see identical voxel tensors) and are tested against the research scripts.

The ``to_dict()`` of this reference's output on the shipped sample is stored per variant as
``samples/test_pcd.<variant>.reference.json``: ``server/smoke_test.py`` compares the served output with it (the
staged PandaSet sample keeps its own next to it, in ``staging_samples_pandaset/``).
"""