Repository navigation
refactor: compose runtimes and processors, add run control and uv packaging - #15
Open
leeclemnet wants to merge 4 commits into
Open
leeclemnet wants to merge 4 commits into
leeclemnet wants to merge 4 commits into
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub. |
…kaging Replace the per-runtime inference subclasses with a Runtime class and a Processor class for each model family. ArtifactBenchmarkRequest takes both. This is the foundation for new export formats (OpenVINO, LiteRT, ExecuTorch, Hailo, Core ML, Core AI) and hosts. It adds no new runtime. - sab/runtimes: Runtime base, ONNXRuntime(device), TRTRuntime - sab/processors.py: Processor base and Pipeline; all 11 scripts migrated - sab/runner.py, results.py: new results schema with a host block, incremental save, resume, --runtimes, --devices, --max_images, --rerun - sab/monitors: NVML monitor (moved), CpufreqMonitor, select_monitor - pyproject.toml + uv.lock replace requirements.txt and setup.py; TensorRT pinned to 10.x (cu13) from the NVIDIA index - pytest suite and a GitHub Actions workflow (Ubuntu, macOS) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
leeclemnet
force-pushed
the
refactor/runtime-processor-composition
branch
from
September 29, 2026 18:46
7092719 to
3993349
Compare
The TensorRT 10 cu13 wheels have no Python 3.14 build. Without a pin, uv picks the newest local Python on some hosts, and `uv sync --extra nvidia` fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remove tests of constants, defaults, one-line delegations, message wording, fakes and library behavior, and merge duplicates. Keep the parity checks against the old request matrices and preprocessing, and the runner, runtime, monitor and results behavior. 232 -> 115 tests. Two checks are new: the runner reads the throttle verdict only after the monitor exits, and normalized_in_graph builds the processor with normalize=False. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 29, 2026
leeclemnet
marked this pull request as ready for review
September 29, 2026 20:48
2 of 7 tasks
- Drop result rows in the old schema, and say which file had them. - Add buffer_time and max_dets to the resume key. - Treat an availability check that raises as "not available". - Reject a symbolic image height, width or channel dimension in ONNX Runtime. - Count CPU frequency polls only while the model runs, so idle cores do not throttle. - Skip benchmark_yololite in benchmark_all, and share the ONNX test helpers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What does this PR do?
Runtimes and processors replace per-runtime subclasses
What it does: Each benchmark row is now a runtime class (how to load and time an artifact) plus a processor class (how one model family does preprocessing and postprocessing). All 11 scripts use this design. Runs now resume, can be filtered, and write each row as soon as it is complete. uv replaces
requirements.txtandsetup.py.Why: Prepares SAB for OpenVINO, LiteRT, ExecuTorch, Core ML and Hailo runtimes. This PR adds no new runtime.
Change map
sab/runtimes/) —Runtimebase class.ONNXRuntime(device)replaces the ONNX CPU and CUDA classes.TRTRuntimereplacesTRTInferenceand now builds its engine itself. The timed region is unchanged.sab/processors.py,sab/models/benchmark_*.py) —Processorholds preprocess, postprocess andextra_inputs.Pipelinejoins a runtime and a processor. Each script has one<Family>Processorand abuild_requests()that gives the same rows as before.sab/request.py,runner.py,results.py,artifacts.py,host.py,benchmark_all.py) —artifact_path,runtime,processor,deviceandprecisionreplaceonnx_path,inference_classandneeds_fp16. The runner filters, skips, resumes and saves atomically after each row..zipartifacts are unpacked.sab/monitors/) — the NVML monitor moved fromclock_watch.pywith no change.CpufreqMonitorreplacesCPUFrequencyMonitor, which read/proc/cpuinfoand always said "stable" on ARM and macOS.pyproject.toml,uv.lock,tests/,.github/workflows/tests.yml) — uv extras for each runtime and host. TensorRT is pinned to 10.x (cu13) from the NVIDIA index. There is a pytest suite, and CI runs it on Ubuntu and macOS.Behavior changes
pip install -r requirements.txt→uv sync --extra nvidia.is_trt,is_cpuandneeds_fp16keys →runtime,device,precision,processor, plus ahostblock.pretty_print_resultsreads only the new schema.--rerun.benchmark_alland each script:--runtimes,--devices,--max_images,--rerun.throttled: alwaysfalseon hosts with no CPU frequency signal →null, and the table shows?. The monitor now watches only the timed pass, not the COCO scoring after it.tensorrt==10.4→tensorrt-cu13>=10.13,<11. Engines cached from 10.4 do not load; SAB builds them again.Watch out for
sab/runtimes/tensorrt.py:334—orig_target_sizes(dfine, rtdetr) now comes fromProcessor.extra_inputs, not fromfill_(1)on the persistent tensor. It must stay all ones, or the boxes change.sab/runtimes/onnxruntime.py:59—dynamic_output_shapes=Truemoves output allocation into the timed call. yololite ONNX latency can rise a little.sab/monitors/cpufreq.py:71— the monitor counts only the polls insidebusy(), whichrun_timed_passputs around eachinfer. The baseline is the first busy poll, not the boosted read after the warm-up. So a scaling governor that slows idle cores between images does not give a throttle report.pyproject.toml:27— TensorRT 11 removesEXPLICIT_BATCHand the FP16/INT8 builder flags, so the<11cap must stay until the build code changes.sab/runner.py:136— the resume key is(artifact_path, runtime, device, precision, max_images, buffer_time, max_dets). A changed artifact under the same name keeps its old row unless you pass--rerun.Related Issue(s): n/a
Type of Change
Testing
Old/new parity on a Tesla T4 (
lee-t4-dev-cu128):rfdetrandyolo26, first 500 COCOval2017images, buffer time 0.Both versions ran in the same venv (TensorRT 10.16 cu13, torch 2.14 cu130, onnxruntime-gpu 1.30) and in the same directory. So the new code used the TensorRT engines that the old code built, and only the code differs.
?for throttling, because this VM has nocpufreqin/sys. The old code read a fixedcpu MHzvalue from/proc/cpuinfo, and so it always reportedno.rf-detr-nano.onnxrf-detr-nano.onnxrf-detr-nano.onnxrf-detr-small.onnxrf-detr-small.onnxrf-detr-small.onnxrf-detr-medium.onnxrf-detr-medium.onnxrf-detr-medium.onnxyolo26n.onnxyolo26n.onnxyolo26n.onnxyolo26s.onnxyolo26s.onnxyolo26s.onnxyolo26m.onnxyolo26m.onnxyolo26m.onnxyolo26l.onnxyolo26l.onnxyolo26l.onnxyolo26x.onnxyolo26x.onnxyolo26x.onnxChecklist
Additional Context
benchmark_yololite.mainstill takesonnx_pathas its first argument, sobenchmark_allcannot run it (as before).🤖 Generated with Claude Code