Skip to content

Commit 916db98

Browse files
feat: add onnx benchmark
1 parent ed8464c commit 916db98

6 files changed

Lines changed: 1260 additions & 0 deletions

File tree

config/benchmark_onnx.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# @package _global_
2+
3+
---
4+
defaults:
5+
- export: null
6+
- _self_
7+
8+
data_dir: ${oc.env:HOME}/data/Niro122-HQ/2023-05-25--09-34-14
9+
start_frame: 2910
10+
num_episodes: 50
11+
frame_step: 10
12+
output: /tmp/rmind.csv
13+
warmup: 1
14+
image_size: null
15+
16+
# override per run, e.g.:
17+
# onnx=/path/to/model.onnx wandb_model=yaak/rmind/model-XXXXXXXX:vN
18+
# export=yaak/control_transformer/finetuned # apples-to-apples vs the ONNX export
19+
onnx: null
20+
wandb_model: null

justfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ test *ARGS: generate-config
8787
update-snapshots:
8888
uv run python -m tests.scripts.update_snapshots
8989

90+
benchmark-onnx *ARGS: generate-config
91+
LD_LIBRARY_PATH="$(find /nix/store -maxdepth 1 -name '*gcc-15*-lib' -type d -print -quit 2>/dev/null)/lib:${LD_LIBRARY_PATH:-}" \
92+
uv run --group benchmark rmind-benchmark-onnx \
93+
--config-path {{ justfile_directory() }}/config \
94+
--config-name benchmark_onnx.yaml \
95+
{{ ARGS }}
96+
9097
export-onnx *ARGS: generate-config
9198
uv run \
9299
--extra export \

pyproject.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ dependencies = [
4141
repo = "https://github.com/yaak-ai/rmind"
4242

4343
[project.scripts]
44+
rmind-benchmark-onnx = "rmind.scripts.benchmark_onnx:main"
4445
rmind-check-git = "rmind.scripts.check_git:main"
4546
rmind-export-onnx = "rmind.scripts.export_onnx:main"
4647
rmind-predict = "rmind.scripts.predict:main"
@@ -76,6 +77,13 @@ dev = [
7677
"pudb>=2025.1.5",
7778
"wat-inspector",
7879
]
80+
benchmark = [
81+
"onnxruntime>=1.23.1",
82+
"opencv-python-headless",
83+
"pyproj>=3.6.0",
84+
"tabulate>=0.9.0",
85+
"wandb>=0.24.2",
86+
]
7987
check = [
8088
"ruff>=0.15.18",
8189
"ty>=0.0.52",
@@ -104,13 +112,18 @@ DEP002 = [
104112
]
105113
DEP003 = ["rmind"]
106114
DEP004 = [
115+
"cv2",
107116
"onnxruntime",
117+
"pyproj",
118+
"tabulate",
108119
"tensorrt",
109120
]
110121

111122
[tool.deptry.package_module_name_map]
112123
hydra-core = "hydra"
124+
opencv-python-headless = "cv2"
113125
tensordict-nightly = "tensordict"
126+
tensorrt-cu13 = "tensorrt"
114127
pytorch-lightning = [
115128
"pytorch_lightning",
116129
"lightning_fabric",

0 commit comments

Comments
 (0)