Skip to content

feat(AWML): introduce new deployment and onnx/tensorRT evaluation pipeline#115

Open
vividf wants to merge 31 commits intomainfrom
feat/new_deployment_and_evaluation_pipeline
Open

feat(AWML): introduce new deployment and onnx/tensorRT evaluation pipeline#115
vividf wants to merge 31 commits intomainfrom
feat/new_deployment_and_evaluation_pipeline

Conversation

@vividf
Copy link
Copy Markdown
Collaborator

@vividf vividf commented Oct 8, 2025

AWML Unified Deployment Framework

Introduced a unified deployment and evaluation framework for AWML, significantly improving consistency, scalability, and maintainability across projects

Key Contributions

1. Unified Deployment Pipeline

  • Standardized model deployment flow: PyTorch → ONNX → TensorRT
  • Eliminated duplicated and project-specific deployment scripts
  • Enabled config-driven, reusable pipelines across multiple models
  • Supported seamless backend switching (PyTorch / ONNX / TensorRT)

2. Cross-Backend Verification

  • Implemented automatic output comparison across backends
  • Ensured numerical consistency between PyTorch, ONNX Runtime, and TensorRT
  • Prevented silent accuracy regressions during deployment
  • Improved reliability for production-level inference

3. Integrated Evaluation Framework

  • Built unified evaluation pipeline based on T4MetricV2
  • Supports:
    • mAP / mAPH
    • Per-class metrics
    • Threshold-based evaluation
    • Enables consistent benchmarking across different backends and models

How to run

python -m deployment.cli.main centerpoint deployment/projects/centerpoint/config/deploy_config.py   projects/CenterPoint/configs/t4dataset/Centerpoint/second_secfpn_8xb16_121m_j6gen2_base_amp_t4metric_v2.py   --rot-y-axis-reference

@vividf vividf changed the title feat(AWML): introduce new deployment and onnx/tensorRT evaluation pipeline WIP: feat(AWML): introduce new deployment and onnx/tensorRT evaluation pipeline Nov 14, 2025
@vividf vividf force-pushed the feat/new_deployment_and_evaluation_pipeline branch from 68d1700 to 7ac5b8b Compare January 29, 2026 08:08
vividf and others added 10 commits March 11, 2026 13:24
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
@vividf vividf force-pushed the feat/new_deployment_and_evaluation_pipeline branch from 5256306 to 2b28f60 Compare March 11, 2026 04:27
vividf and others added 14 commits March 25, 2026 20:49
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@vividf vividf self-assigned this Apr 14, 2026
vividf added 2 commits April 16, 2026 16:16
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
vividf added 4 commits April 16, 2026 20:56
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
@vividf vividf marked this pull request as ready for review April 20, 2026 12:41
@vividf vividf requested a review from KSeangTan as a code owner April 20, 2026 12:41
@vividf vividf changed the title WIP: feat(AWML): introduce new deployment and onnx/tensorRT evaluation pipeline feat(AWML): introduce new deployment and onnx/tensorRT evaluation pipeline Apr 20, 2026
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
@vividf vividf force-pushed the feat/new_deployment_and_evaluation_pipeline branch from 8756669 to 1d4c27f Compare April 20, 2026 13:05
Copy link
Copy Markdown
Collaborator

@KSeangTan KSeangTan left a comment

Choose a reason for hiding this comment

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

Only review the first part, please address the comments accordingly first.

Comment thread deployment/cli/args.py
Args:
log_file_path: Absolute or resolved path to the log file.
"""
path = os.path.abspath(os.path.expanduser(log_file_path))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Use pathlib instead

Comment thread deployment/cli/args.py
ArgumentParser with deployment arguments
"""
if parser is None:
parser = argparse.ArgumentParser(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why parser can be None?

Comment thread deployment/cli/main.py
from deployment.projects.registry import project_registry


def _discover_project_packages() -> List[str]:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sequence instead of List

raise ValueError("Missing 'export' section in deploy config.")
export_raw = self.deploy_cfg.get("export")
if export_raw is not None and not isinstance(export_raw, Mapping):
raise TypeError("deploy config 'export' must be a mapping.")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

mapping might not be an appropriate type in the error message here, it should be Dict instead?

raise TypeError("deploy config 'components' must be a mapping.")

@staticmethod
def _parse_deploy_log_path(raw: Optional[Any]) -> Optional[str]:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I dont think we should accept Any here, please make it str only. These type checking should actually be done by IDE in static checking instead of runtime.

"""Require a non-empty checkpoint path that exists as a regular file."""
if not isinstance(checkpoint_path, str):
raise TypeError(f"checkpoint_path must be a string, got {type(checkpoint_path).__name__}.")
path = os.path.expanduser(checkpoint_path.strip())
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Use pathlib instead


def _needs_cuda_device(self) -> bool:
"""Determine if current deployment config requires a CUDA device."""
if self.export_config.should_export_tensorrt:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I believe this function is unnecessary complicated, for example, we only need to check if tensorrt is enabled since we will use only tensorrt with cuda right?

return self._verification_config

@property
def devices(self) -> DeviceConfig:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

device_config

if not output_names:
output_names = ("output",)
settings_dict = {
"opset_version": onnx_config.opset_version,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

self._onnx_export_config.opset_config



def _normalize_dynamic_axes(raw: Mapping[str, Any]) -> Dict[str, Dict[int, str]]:
"""Normalize dynamic_axes inner dict keys to int."""
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What does it mean by normalizing?

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.

2 participants