Skip to content

Optimize RF-DETR object detection pre/post-processing#2667

Open
dkosowski87 wants to merge 27 commits into
mainfrom
optimize/rf-detr-object-detection
Open

Optimize RF-DETR object detection pre/post-processing#2667
dkosowski87 wants to merge 27 commits into
mainfrom
optimize/rf-detr-object-detection

Conversation

@dkosowski87

@dkosowski87 dkosowski87 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Linked issue: None.

This PR optimizes the RF-DETR TensorRT inference path while introducing a reusable architecture for selecting and managing alternative inference-stage implementations. It preserves the TensorRT semantic forward boundary while allowing preprocessing and postprocessing strategies to evolve independently.

The implementation introduces immutable execution plans, typed compatibility metadata, runtime execution contexts, and a registry responsible for strict implementation selection. RF-DETR clients can select implementations through an explicit execution plan or environment variables, including clients that cannot pass backend-specific arguments. Non-supported paths currently fallback to base processors. Reusable control-plane components live under models/optimization, while RF-DETR contracts, catalogs, configuration, and concrete implementations remain model-local. CUDA-event readiness tracking preserves asynchronous dependencies between preprocessing and TensorRT without attaching dynamic state to tensors. Runtime metadata exposes the resolved plan and selected implementations for profiling and validation.

Main elements:

  • Reusable optimization contracts, execution plans, registry, IDs, and tensor-readiness tracking
  • Separate base, threaded, and Triton RF-DETR preprocessing implementations
  • Separate base and fused Triton RF-DETR postprocessing implementations
  • Environment-variable and explicit execution-plan selection
  • Strict implementation compatibility checks and conservative auto selection
  • Machine-readable runtime implementation metadata
  • RF-DETR optimization architecture documentation with Mermaid diagrams
  • Unit coverage for shared framework behavior, RF-DETR selection, compatibility, parity, and readiness
  • No new runtime dependencies

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other:

How to enable?

export INFERENCE_MODELS_RFDETR_PREPROCESSOR="triton-universal-v1"
export INFERENCE_MODELS_RFDETR_POSTPROCESSOR="triton-fused-v1"

Latency Profile

Run ID: profile-latency-20260716-191752
Host: orin-agx-jp62 (Orin, compute capability 8.7)
Date: 2026-07-16
Docker image: roboflow/roboflow-inference-server-jetson-6.2.0:1.3.5
Runtime ref: optimize/rf-detr-object-detection (d00376b3)
Profiler ref: main (edd68971)
Preprocessor / postprocessor: triton-universal-v1 / triton-fused-v1 (env overrides)
Iterations: 20 warmup / 100 measured (5 repetitions, convergence threshold 0.05)
Package: trt, fp16

Scenario: camera_3840x2160_batch_4_high (3840×2160, batch 4)

Run mean ms p50 p95 p99
before 436.8 440.4 443.5 444.3
after 36.03 36.02 36.29 36.41

Scenario: camera_640x480_batch_1_base (640×480, batch 4)

Run mean ms p50 p95 p99
before 17.3 17.2 19.1 19.8
after 7.44 7.43 7.56 7.61

Memory Profile

Run ID: profile-memory-20260716-201948
Host: orin-agx-jp62 (Orin, compute capability 8.7, integrated memory)
Date: 2026-07-16
Docker image: roboflow/roboflow-inference-server-jetson-6.2.0:1.3.5
Iterations: 5 warmup / 20 measured
Scenario: camera_3840x2160_batch_4_high
Runtime ref: optimize/rf-detr-object-detection (d00376b3)
Package: trt, fp16

GPU memory used whole-device CUDA accounting (cuda_device) with the pre-load baseline subtracted. Competing GPU workloads can still inflate whole-device readings.

GPU memory

Run Residency MiB Peak MiB Incremental MiB Source
before 124.4 615.4 491.0 cuda_device
after 123.0 392.5 269.4 cuda_device

Snapshot parity validation

Compared end-to-end inference snapshots on Orin AGX (JP 6.2) to verify that the Triton fused pre/post path produces the same results as the baseline runtime.

Method

Used the snapshot-model-output remote-runner recipe to capture exact invocation inputs and postprocessed outputs (typed JSON + lossless NPY sidecars) for a single deterministic workload:

Parameter Value
Host orin-agx-jp62
Model rfdetr-small
Package bbf73c3014b86386434c8051f132cdf2 (TRT fp16)
Scenario camera_640x480_batch_1_base
Input COCO val2017 000000000139.jpg → 640×480
Docker image roboflow/roboflow-inference-server-jetson-6.2.0:1.3.5
Profiler inference-profiler@main (edd6897)

Runs compared

Baseline Candidate
Run ID snapshot-model-output-20260716-155717 snapshot-model-output-20260716-132958
Runtime ref main (e3d91414) codex/rfdetr-triton-fused-postprocess-v1 (c9c6fc54)
Preprocessor default triton-universal-v1
Postprocessor default triton-fused-v1

Array comparison

Compared all NPY artifacts under
model-output-snapshots/bbf73c3014b86386434c8051f132cdf2/default/camera_640x480_batch_1_base/arrays/:

Artifact Description Result
input-0000.npy Preprocessed image (480×640×3, uint8) Exact match (0/921,600 differing pixels)
output-0002.npy Confidence scores (16 × float32) Exact match (bit-identical)
output-0000.npy Bounding boxes xyxy (16×4, int32) Order differs for 2 tied detections
output-0001.npy Class IDs (16 × int32) Order differs for same 2 tied detections

Tie-breaking note

14/16 detections match at the same array index. The only positional difference is indices 11 and 12, where two detections with identical confidence (0.58130306) are swapped:

Index Baseline (main) Candidate (Triton)
11 class 82, [490, 193, 514, 320] class 86, [166, 263, 186, 301]
12 class 86, [166, 263, 186, 301] class 82, [490, 193, 514, 320]

When sorted by (confidence, class_id, xyxy), all 16 detections match exactly between runs. This is consistent with non-deterministic tie-breaking in NMS/postprocess ordering, not a semantic output difference.

Conclusion

For this workload on Orin AGX:

  • Preprocessing is identical — input tensor is bit-exact.
  • Postprocessed detections are identical as a set — same boxes, classes, and confidence values.
  • No confidence or geometry drift was observed beyond reordering of two equal-confidence detections.

This snapshot comparison demonstrates functional parity between the baseline and Triton fused pre/post implementations for rfdetr-small TRT fp16 on Jetson Orin.

Testing

Unit tests

  • Shared optimization metadata, execution-plan serialization, registry resolution, validation matching, and exact-tensor readiness tracking
  • RF-DETR environment and explicit-plan selection behavior
  • Unknown and incompatible explicit implementation rejection
  • Immutable and JSON-serializable implementation metadata
  • NumPy, CPU tensor, and CUDA tensor preprocessing input handling
  • Threaded and Triton preprocessing behavior
  • Fused Triton postprocessing parity with the reference PyTorch path
  • CUDA/Triton tests are conditionally skipped when the required target runtime is unavailable

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in hard-to-understand areas
  • My changes generate no new warnings or errors
  • I have updated the documentation accordingly (if applicable)

…preprocessor implementation. This update includes a new `resolve_rfdetr_preprocessor` function for selecting preprocessing strategies, and integrates preprocessor configuration into the `pre_process_network_input` function. Additionally, the `RFDetrForObjectDetectionTRT` class now supports customizable preprocessor settings, improving flexibility for users. Updated error handling for unsupported input types and added logging for selected preprocessors.
…ging to better reflect the significance of selected implementations.
This commit introduces a new preprocessor implementation, `RFDETR_PREPROCESSOR_TRITON_UNIVERSAL_V1`, enhancing the RF-DETR model's preprocessing capabilities. The implementation supports various input types and optimizes CUDA processing. Additionally, it integrates with the `RFDetrForObjectDetectionTRT` class, allowing for streamlined preprocessing during inference. A new runtime class, `UniversalFastPreprocessRuntime`, is added to handle the preprocessing logic, and corresponding unit tests are included to ensure functionality and compatibility.
This commit introduces a new postprocessing module for RF-DETR, including the `FusedObjectDetectionPostprocessor` that optimizes object detection results using Triton. The implementation allows for explicit selection of postprocessor strategies, enhancing flexibility during inference. Additionally, the `RFDetrForObjectDetectionTRT` class is updated to support the new postprocessor, and corresponding unit tests are added to validate functionality and performance. This update aims to improve efficiency and streamline the postprocessing workflow for RF-DETR models.
…iable support

This commit introduces support for environment variables in the RF-DETR preprocessing and postprocessing modules. New environment variables, `INFERENCE_MODELS_RFDETR_PREPROCESSOR` and `INFERENCE_MODELS_RFDETR_POSTPROCESSOR`, allow users to specify preprocessing and postprocessing strategies without modifying code. The `resolve_rfdetr_preprocessor` and `resolve_rfdetr_postprocessor` functions are updated to utilize these environment variables, enhancing flexibility. Additionally, new unit tests validate the correct behavior of these features, ensuring robust functionality across different configurations.
This commit introduces a new `RFDetrExecutionPlan` class that allows users to define a composed execution plan for RF-DETR inference, enabling independent selection of preprocessing, postprocessing, buffer strategy, scheduler, and engine plugin stages. The implementation ensures that explicit plans cannot be combined with legacy arguments, enhancing clarity and usability. Additionally, the `RFDetrForObjectDetectionTRT` class is updated to support this new execution plan, improving the flexibility of inference configurations. Corresponding updates are made to the preprocessing and postprocessing modules to integrate with the new execution plan structure.
…d integration

This commit introduces a new documentation file detailing the Inference-Path Optimization Architecture, explaining the selection and execution of inference-path implementations. It includes a flowchart visualized with Mermaid to illustrate the architecture's components and their interactions. Additionally, the mkdocs configuration is updated to include the new documentation and enable Mermaid support for enhanced visual representation. References to this architecture are added in relevant sections of the environment variables and RF-DETR object detection documentation, improving clarity and accessibility for users.
This commit introduces a comprehensive refactor of the RF-DETR optimization architecture, creating reusable components for inference-path implementations. New modules for contracts, execution plans, and a context-aware registry are added to enhance flexibility and maintainability. The `RFDetrExecutionPlan` class is updated to support independent selection of preprocessing, postprocessing, and other stages, while ensuring compatibility with environment variables. Documentation is also improved to clarify the architecture and its components, facilitating better user understanding and integration.
…d postprocessor implementation selections to better reflect their significance in the inference process.
…and fallback mechanisms

This commit introduces a new `CompatibilityResult` class to encapsulate the results of compatibility checks for preprocessing implementations. It adds methods for checking model and request compatibility across various preprocessors, ensuring that incompatible configurations are handled gracefully with declared fallbacks. The `resolve_preprocessor_for_model` and `resolve_preprocessor_for_request` functions are updated to utilize these compatibility checks, logging fallback reasons when applicable. Additionally, the documentation is updated to reflect these changes, improving clarity on how preprocessing selections are made and their implications for inference execution.
@github-actions

Copy link
Copy Markdown
Contributor

👋 Thanks for the pull request! Here is how automated Claude review works here, so you spend credits (and reviewer time) wisely.

🚦 This PR is marked Ready for review, so automated Claude review will run — and every pass spends real credits.

Warning

💸 The Claude reviewer bills in credits, not vibes

Automated review spins up a real agent that reads real code and spends real credits on every pass. It is glad to help — but it is not a rubber duck, a linter you poke in a loop, or a substitute for reading the contributing guide. Treat it like an expensive senior reviewer whose time you booked, and show up prepared.

Draft when unsure, Ready when you mean it:

  • 🌱 Not sure the PR is in good shape yet? Keep it (or set it back) as a draft — drafts pause review, so you can push and iterate without burning credits on a moving target.
  • 💪 Feel strong about the contents? Mark it Ready for review and the reviewer will take a look.

However you get there, arrive prepared:

  • 🧱 Bring a SOLID, thorough PR. Point your local agent at our skills/ to tune it to our guidelines first — or, if you are one of those fabled carbon-based contributors, read them yourself. A half-baked diff costs exactly the same to review as a finished one.
  • Resolve every comment before you re-request review. Re-requesting with threads still open means paying twice for the same conversation.
  • 🔁 Do not use CI review as an inner loop for a local agent. The reviewer is not a step-by-step debugger — do the unfolding locally and arrive with the answer, not the search.
  • 🙋 If something looks off, ask a human. One question to a maintainer is cheaper and faster than three rounds of agent re-review chasing a misread.

Reviews are not free. A draft costs nothing to review; a Ready PR is a promise that it is worth reviewing.

  • Prefer to skip automated review entirely? Add the skip-claude-review label.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Claude review started at commit 748ad91402ecf96c861713a80a2a2cffa4ed4cb4.

New commits are not auto-reviewed. Add the claude-review label (remove & re-add it to trigger again) when you want another review.

See [Inference-Path Optimization Architecture](../contributors/inference-path-optimization-architecture.md)
for the selection model and the complete RF-DETR execution flow.

**`INFERENCE_MODELS_RFDETR_PREPROCESSOR`**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Medium — missing changelog entry (and version bump if 0.31.0 is already released).

This PR adds user-visible surface — three new env vars (INFERENCE_MODELS_RFDETR_PREPROCESSOR, ..._PREPROCESSOR_MAX_WORKERS, ..._POSTPROCESSOR), a new public API (RFDetrExecutionPlan), and new from_pretrained kwargs (rfdetr_preprocessor_max_workers, rfdetr_execution_plan) — but inference_models/docs/changelog.md has no entry describing it, and inference_models/pyproject.toml is unchanged (still 0.31.0, same as the base SHA).

Per the inference_models contribution convention, a functional/user-visible change requires a docs/changelog.md entry (under the current version heading) and, if 0.31.0 has already been published to PyPI, a version bump. Please add a changelog entry for the RF-DETR pre/post-processing optimization and confirm whether 0.31.0 still needs a bump.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changelog entry added.

@github-actions

Copy link
Copy Markdown
Contributor

@dkosowski87

This PR is on hold pending your answers — the review will not advance to sign-off and the PR should not proceed to merge until the IMPORTANT questions below are answered.

Thanks for the thorough PR — the design is clean, the default (base) pre/post path is preserved behaviorally, the box-rescale math in the fused Triton kernel matches the reference rescale_image_detections path, and the attached Orin AGX latency + snapshot-parity evidence is appreciated. I have no hard blocker, but a few items need clarification before this can pass, plus one documentation gap (raised inline).

IMPORTANT — please answer

  1. Silent preprocessor fallback vs. strict postprocessor (semantic change / silent backend downgrade).
    In optimization/selection.py, an explicitly requested preprocessor (e.g. triton-universal-v1 via env var or plan) that declares the model/request contract incompatible now falls back to base with only a LOGGER.warning (_apply_declared_fallback), while the postprocessor (triton-fused-v1) is resolved directly in __init__/post_process and raises on incompatibility. Two questions:

    • Is this asymmetry (preprocessor silently downgrades, postprocessor hard-fails) intended?
    • A user who sets INFERENCE_MODELS_RFDETR_PREPROCESSOR=triton-universal-v1 expecting the optimized path could silently run base with no error and only a log line. The PR description still states "Explicit optimized selections reject incompatible inputs instead of silently falling back or introducing hidden conversions," which now contradicts the shipped 748ad91 behavior. Please confirm the intended contract and align the PR description (the in-repo docs were updated, the PR body was not).
  2. Parity re-verification at HEAD. The snapshot-parity validation in the PR body was captured at c9c6fc54 (commit 4), i.e. before the commits 6–10 refactor into models/optimization/** + rfdetr/optimization/** and before the fallback mechanism landed in 748ad91. The GPU/Triton numerical-parity tests (test_fused_postprocessor_matches_reference, and the universal-preprocessor uint8 Triton path) are skipif(not cuda or not triton) and therefore do not run in CPU CI. Was end-to-end pre/post parity re-verified against the reference path at HEAD (748ad91), or does the parity evidence only cover the pre-refactor kernels? A short confirmation (or a re-run) that the shipped code still produces the reference detections would resolve this.

Optional

  • The new selection env vars are validated at resolve/registry time (raising ModelRuntimeError on unknown values) rather than centrally in configuration.py via InvalidEnvVariable, unlike other INFERENCE_MODELS_* flags. Not a blocker — just flagging the deviation from the convention in case you want consistency.

Documentation (see inline)

  • No docs/changelog.md entry for the new env vars / RFDetrExecutionPlan API / from_pretrained kwargs, and pyproject.toml version is unchanged from base. Please add a changelog entry and confirm whether 0.31.0 needs a bump.

⚠️ Unanswered IMPORTANT questions may prevent this PR from being included in a release. New commits are NOT auto-reviewed — after you answer and/or push changes, add the claude-review label (remove and re-add it to trigger again) to request a fresh review.

Reviewed at HEAD: 748ad91

dkosowski87 and others added 2 commits July 16, 2026 21:51
This commit introduces the `allow_compatibility_fallback` parameter to the `RFDetrExecutionPlan`, enabling users to specify whether to allow fallback to a base implementation when an explicitly requested implementation is incompatible. The documentation is updated to clarify the implications of this setting, and the relevant selection functions are modified to respect this new parameter. Additionally, unit tests are added to validate the behavior of the fallback mechanism across preprocessing and postprocessing stages, ensuring robust handling of compatibility checks during inference execution.
@dkosowski87

dkosowski87 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Silent preprocessor fallback vs. strict postprocessor (semantic change / silent backend downgrade).

Issue should be fixed now.

Parity on newest

Confirmed: 931 detection, 4 of them had a 1 px box difference between runs, this is on a 3840x2160 resolution, the rest was identical.

Enhance the RFDetrForObjectDetectionTRT class to support an independent stage execution mode. This allows public preprocessing to return a ready tensor without relying on the model's readiness state during the forward pass. Update documentation to reflect this new feature and provide usage examples. Add integration tests to ensure the new functionality works as expected, matching outputs with composed inference. The default behavior remains asynchronous to preserve existing optimizations.
…ty checks

- Change default preprocessor to `triton-universal-v1` and postprocessor to `triton-fused-v1` in the RF-DETR execution plan.
- Update documentation to clarify the behavior when no explicit plan or environment overrides are provided.
- Add compatibility checks in postprocessing and preprocessing classes to report Triton availability issues.
- Enhance unit tests to validate the new default behavior and Triton dependency checks.
…ent stage execution

- Updated RF-DETR TensorRT to default to `triton-universal-v1` preprocessing and `triton-fused-v1` postprocessing.
- Introduced breaking changes for independent stage execution, requiring `independent_stage_execution=True` for callers using `pre_process()` and `forward()` separately.
- Added documentation for new execution plan features, including environment variable controls and usage examples for independent stage execution.
- Improved compatibility checks and metadata reporting for preprocessing and postprocessing implementations.
@dkosowski87

Copy link
Copy Markdown
Contributor Author
  • Added CHANGE requested by @PawelPeczek-Roboflow to allow for independent pre_process / forward call. Thus immediately synchronising the events.
  • Changed the optimized pre-processor and post-processor to be the default
  • Added docs and CHANGELOG entry

@dkosowski87 dkosowski87 added the claude-review Use to trigger AI review manually label Jul 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Claude review started at commit 93e1b9c01897fef742f67f26f9e968ebb32464bd.

New commits are not auto-reviewed. Add the claude-review label (remove & re-add it to trigger again) when you want another review.

Comment on lines +482 to +483
if pre_processing_overrides is not None:
unsupported.append("pre-processing overrides")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Medium — the new default triton-universal-v1 preprocessor always falls back to base (and warns per request) on the standard inference-server path.

This check marks any non-None pre_processing_overrides as incompatible. But the core adapter that drives RF-DETR through the server always constructs one:

# inference/core/models/inference_models_adapters.py  (InferenceModelsObjectDetectionAdapter)
def map_inference_kwargs(self, kwargs: dict) -> dict:
    kwargs["input_color_format"] = "bgr"
    pre_processing_overrides = PreProcessingOverrides(         # never None
        disable_contrast_enhancement=kwargs.get("disable_preproc_contrast", False),
        disable_grayscale=kwargs.get("disable_preproc_grayscale", False),
        disable_static_crop=kwargs.get("disable_preproc_static_crop", False),
    )
    kwargs["pre_processing_overrides"] = pre_processing_overrides
    return kwargs

PreProcessingOverrides defaults every field to False (a no-op), and check_model_compatibility above already rejects models whose config has static_crop/contrast/grayscale enabled — so for any model that reaches the Triton preprocessor these disable-flags are meaningless. Yet because the object is non-None, resolve_preprocessor_for_request (with the default allow_compatibility_fallback=True) falls back to base on every request, and pre_process() emits LOGGER.warning(...) on every call.

Net effect through the primary runtime:

  1. The advertised default preprocessing optimization (triton-universal-v1) is never active for RF-DETR served via inference_models — it silently runs base. (This is consistent with the PR's own snapshot note that "Preprocessing is identical — input tensor is bit-exact"; base vs. base is trivially bit-exact.)
  2. A WARNING line is logged per inference — log spam under load.

Suggest inspecting the override fields (treat an all-False override as compatible) rather than rejecting on is not None, and/or de-duplicating the per-request fallback warning (warn-once). Please confirm the intended behavior.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is consistent with the PR's own snapshot note that "Preprocessing is identical — input tensor is bit-exact"; base vs. base is trivially bit-exact.

The snapshot is checked on inference_models model infer method thus doesn't go through the inference/core/models/inference_models_adapters.py. It doesn' resolve to the trivial solution.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

PreProcessingOverrides with default False values now handled correctly

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Warning only logged once per (stage, requested_id, effective_id, reason)

@github-actions

Copy link
Copy Markdown
Contributor

@dkosowski87

This PR is on hold pending your answer — the review will not advance to sign-off and the PR should not proceed to merge until the IMPORTANT question below is resolved.

Thanks for the follow-ups. I re-reviewed the delta since my last pass (748ad91): the fallback logic is now symmetric across pre/post (_apply_declared_fallback + allow_compatibility_fallback), the defaults were flipped to the Triton path, independent_stage_execution was added, and a changelog entry now covers all of it. I verified the async default is safe through the standard infer() path (the exact preprocessed tensor flows through Model.infer to predict on the same instance, so PreprocessReadinessTracker keys correctly). The prior two IMPORTANT questions (fallback asymmetry, parity re-verification) are addressed.

Flipping the default to Triton, however, surfaced one new concern.

IMPORTANT — please answer

  1. The new default triton-universal-v1 preprocessor always falls back to base (and warns per request) on the primary inference-server path (inline detail on triton_universal_preprocess_runtime.py:482). InferenceModelsObjectDetectionAdapter.map_inference_kwargs (inference/core/models/inference_models_adapters.py:210) unconditionally builds a non-None PreProcessingOverrides (all fields default False = no-op), and the Triton preprocessor check_request_compatibility rejects ANY non-None overrides object. With the default allow_compatibility_fallback=True, every RF-DETR request served through inference_models (a) silently runs base instead of the advertised optimized preprocessor, and (b) logs a LOGGER.warning on every pre_process() call. Since check_model_compatibility already excludes models with contrast/grayscale/static-crop enabled, an all-False override is meaningless for any Triton-eligible model. Is the always-fallback intended, or should the check inspect the override FIELDS? Either way, please address the per-request warning (e.g. warn-once) so it is not emitted on every inference.

Optional / carry-forward

  • The PR DESCRIPTION still states "Explicit optimized selections reject incompatible inputs instead of silently falling back or introducing hidden conversions." With the shipped default (allow_compatibility_fallback=True for env-var and default selections), that only holds when a caller explicitly passes RFDetrExecutionPlan(allow_compatibility_fallback=False). The in-repo docs were updated; please align the PR body too. (Cosmetic — does not block.)

⚠️ Unanswered IMPORTANT questions may prevent this PR from being included in a release. New commits are NOT auto-reviewed — after you answer and/or push changes, add the claude-review label (remove and re-add it to trigger again) to request a fresh review.

Reviewed at HEAD: 93e1b9c

@github-actions

Copy link
Copy Markdown
Contributor

Release coordination (maintainers) — This PR makes a functional, user-visible change to inference_models (new default RF-DETR TensorRT pre/post implementations, RFDetrExecutionPlan public API, new INFERENCE_MODELS_RFDETR_* env vars, and new from_pretrained kwargs). The contributor has added the ## Unreleased entry in inference_models/docs/changelog.md, so no contributor action is needed there.

inference-models requires a version bump for release. At release time, maintainers choose the version, update inference_models/pyproject.toml (currently unchanged from base) and any lock-step pins/lockfiles, and move the Unreleased entries into the final version heading.

Reviewed at HEAD: 93e1b9c

@PawelPeczek-Roboflow PawelPeczek-Roboflow left a comment

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 we need bump in version of inference models

…patibility checks

- Introduced `FallbackWarningTracker` to ensure each distinct fallback warning is logged only once per model instance, improving logging efficiency.
- Updated RF-DETR model to utilize the new tracker for preprocessing and postprocessing fallback warnings.
- Enhanced documentation to clarify the behavior of active preprocessing overrides and their impact on compatibility checks.
- Added unit tests to validate the functionality of the fallback warning system and its thread safety.
- Bump project version in `pyproject.toml` to 0.32.0.
- Update `uv.lock` revision to 3.
- Document changes in `changelog.md`, including updates to RF-DETR TensorRT object detection and other enhancements.
@dkosowski87

Copy link
Copy Markdown
Contributor Author

Inference models version bumped to 0.32.0

@dkosowski87 dkosowski87 added claude-review Use to trigger AI review manually and removed claude-review Use to trigger AI review manually labels Jul 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Claude review started at commit 84b064b1d26c4ac470285d34f073b3605106fb8c.

New commits are not auto-reviewed. Add the claude-review label (remove & re-add it to trigger again) when you want another review.

@github-actions

Copy link
Copy Markdown
Contributor

Release coordination (maintainers) — refresh of the prior notice.

The contributor has now bumped inference-models 0.31.00.32.0 consistently (inference_models/pyproject.toml, inference_models/uv.lock, and the ## 0.32.0 changelog heading with a fresh ## Unreleased above it). This resolves @PawelPeczek-Roboflow's version-bump request. inference-models requires this version for release — the internal bump is self-consistent; nothing further is needed inside the inference_models package.

One cross-package heads-up for the eventual inference server release (not a blocker for this PR, and not owned by it):

  • requirements/requirements.{cpu,gpu,jetson,vino}.txt still pin inference-models~=0.31.0, which under PEP 440 means >=0.31.0,<0.32.0 and therefore excludes 0.32.0. Until those pins are bumped (to ~=0.32.0) at the inference release, a released/rebuilt inference server will keep resolving inference-models 0.31.x, so the new default RF-DETR TensorRT pre/post optimizations will not reach server users. This is standard cross-package release timing (the pins live in the separate inference package, unchanged here at 1.3.6) — flagging so it isn't missed. No lock-step assertion test enforces it, so it will not fail CI.

Commands that informed this review: gh pr diff, gh api .../pulls/2667/{commits,comments,reviews}, and reads of triton_universal_preprocess_runtime.py, fallback_warnings.py, rfdetr_object_detection_trt.py, inference_models_adapters.py, pyproject.toml, uv.lock, and the delta tests.

Reviewed at HEAD: 84b064b

@github-actions

Copy link
Copy Markdown
Contributor

😎 PR passes the vibe-check and trust-me-bro verification.

- Bumped the version of `inference-models` to 0.32.0 in `requirements.cpu.txt`, `requirements.gpu.txt`, `requirements.jetson.txt`, and `requirements.vino.txt` to ensure consistency across environments.
@dkosowski87

Copy link
Copy Markdown
Contributor Author

Inference requirements files updated for new inference-models version.

…tage handling

- Update changelog to clarify the backward compatibility of direct RF-DETR TensorRT stage calls, ensuring public `pre_process()` synchronizes by default.
- Revise documentation to reflect the new default behavior of public preprocessing and its interaction with composed inference calls.
- Enhance the `RFDetrForObjectDetectionTRT` class to streamline the handling of independent stage execution, removing the need for the `independent_stage_execution` parameter in the constructor.
- Improve integration tests to validate the new behavior and ensure consistency across public stage calls.
- Bump version in `pyproject.toml` and `uv.lock` to 0.32.0rc3 for consistency across the project.
@PawelPeczek-Roboflow
PawelPeczek-Roboflow self-requested a review July 21, 2026 09:55

@PawelPeczek-Roboflow PawelPeczek-Roboflow left a comment

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.

LGTM

when CI passes, 0.32.0 release to be done + requirements update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-review Use to trigger AI review manually

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants