Skip to content

[OMNIML-5774] Add BEVFormer ONNX PTQ and evaluation example - #2208

Draft
ajrasane wants to merge 1 commit into
ajrasane/petrfrom
ajrasane/bevformer-onnx-ptq
Draft

[OMNIML-5774] Add BEVFormer ONNX PTQ and evaluation example#2208
ajrasane wants to merge 1 commit into
ajrasane/petrfrom
ajrasane/bevformer-onnx-ptq

Conversation

@ajrasane

Copy link
Copy Markdown
Contributor

What does this PR do?

Type of change: new example

Adds an end-to-end BEVFormer-tiny ONNX PTQ example under examples/onnx_ptq/bevformer. The example provides a pinned container environment, temporal calibration-data generation, INT8 and FP8 quantization, TensorRT engine building, full nuScenes accuracy evaluation, and latency benchmarking.

The workflow extends NVIDIA's DL4AGX BEVFormer INT8 example with FP8 support and reuses the shared bounded NpzCalibrationReader introduced by #2180. It also adds temporal-state unit coverage, links the example from the ONNX PTQ index, and updates the changelog.

Usage

python examples/onnx_ptq/bevformer/quantize.py \
  --onnx=/artifacts/bevformer_tiny_epoch_24_cp2_op13.onnx \
  --calibration-dir=/artifacts/calibration \
  --trt-plugins=/workspace/BEVFormer_tensorrt/TensorRT/lib/libtensorrt_ops.so \
  --quantization-mode=fp8 \
  --output=/artifacts/bevformer_tiny_epoch_24_cp2_op13.fp8.onnx

Testing

  • Ran the targeted CPU-only unit tests: 10 passed.
  • Ran all applicable pre-commit hooks, including Ruff, mypy, Bandit, markdownlint, license checks, and requirements validation.
  • Generated 600 temporal calibration samples and validated the INT8 and FP8 ONNX graphs.
  • Built FP16, INT8, and FP8 TensorRT 10.14.1.48 engines on an NVIDIA RTX 6000 Ada Generation GPU.
  • Evaluated all 6,019 nuScenes validation samples.
Precision Median GPU compute time NDS mAP
FP16 4.597 ms 0.3546 0.2515
INT8/FP16 3.180 ms 0.3512 0.2505
FP8/FP16 4.106 ms 0.3526 0.2489

Before your PR is "Ready for review"

Make sure you read and follow Contributor guidelines and your commits are signed (git commit -s -S).

Make sure you read and follow the Security Best Practices (e.g. avoiding hardcoded trust_remote_code=True, torch.load(..., weights_only=False), pickle, etc.).

  • Is this change backward compatible?: ✅
  • If you copied code from any other sources or added a new PIP dependency, did you follow guidance in CONTRIBUTING.md: ✅
  • Did you write any new necessary tests?: ✅
  • Did you update Changelog?: ✅

Additional Information

This PR is stacked on #2180 to reuse its shared calibration reader and should be retargeted to main after #2180 merges.

Reference workflow: NVIDIA DL4AGX BEVFormer INT8 example.

🤖 Generated by Codex (AI agent).

Co-Authored-By: Codex <codex@openai.com>
Signed-off-by: ajrasane <131806219+ajrasane@users.noreply.github.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: d9b6e859-c415-437f-8836-ffb411715782

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

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