Repository navigation
Fix GPU benchmark lazy device placement - #22
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/roboflow/rf-detr_plus/sessions/d3c44307-cdb4-48ca-97a1-c184b5697489 Co-authored-by: Borda <6035284+Borda@users.noreply.github.com>
Borda
marked this pull request as ready for review
April 16, 2026 20:02
Borda
requested review from
Borda,
SkalskiP,
isaacrob and
probicheaux
as code owners
April 16, 2026 20:02
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the COCO GPU inference benchmark in rfdetr_plus tests when RF-DETR uses lazy device placement, by ensuring the underlying nn.Module weights are moved onto the benchmark’s selected device before directly calling the raw model.
Changes:
- Explicitly moves
rfdetr.model.modelto the chosendevicein the COCO detection inference benchmark. - Adds inline comments explaining why the benchmark must materialize device placement (since it bypasses public inference APIs).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22 +/- ##
==================================
Coverage 94% 94%
==================================
Files 6 6
Lines 71 71
==================================
Hits 67 67
Misses 4 4 🚀 New features to boost your workflow:
|
Borda
approved these changes
Apr 16, 2026
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.
PR Checklist
Changes
The GPU COCO benchmark was forwarding CUDA tensors through a model whose weights were still on CPU. This regressed after RF-DETR moved to lazy device placement, which the benchmark bypasses by calling the raw model directly.
Benchmark device sync
nn.Moduleonto the requested test device immediately after model construction in the GPU/CPU benchmark path.rfdetr.model.model(...)directly.Behavioral intent
Related