Skip to content

Add GPU-resident YOLO26 video inference example (rocDecode + MIGraphX)#451

Open
itikhono wants to merge 3 commits into
ROCm:amd-stagingfrom
itikhono:add-gpu-resident-yolo26-pipeline
Open

Add GPU-resident YOLO26 video inference example (rocDecode + MIGraphX)#451
itikhono wants to merge 3 commits into
ROCm:amd-stagingfrom
itikhono:add-gpu-resident-yolo26-pipeline

Conversation

@itikhono
Copy link
Copy Markdown

@itikhono itikhono commented May 11, 2026

Summary

New Python example under AI/MIGraphX/gpu_resident_yolo26_pipeline/ demonstrating a zero-copy decode-to-detection pipeline on AMD GPUs:

This is the companion code for the upcoming ROCm blog post Building a GPU-Resident YOLO26 Object Detection Pipeline on the AMD Radeon AI PRO R9700 GPU (ROCm/rocm-blogs#355).

  • rocDecode / rocPyDecode decodes the H.264 bitstream on the on-chip VCN engine and exposes the surface via DLPack.
  • PyTorch + DLPack wraps it as a zero-copy CUDA tensor and runs YOLO26 letterbox preprocessing on the active HIP stream.
  • MIGraphX runs inference of the FP16-compiled YOLO26 graph asynchronously on the same HIP stream and returns detections directly into a pre-allocated PyTorch tensor.
  • OpenCV draws the surviving bounding boxes onto each frame and writes the annotated MP4 output.
image

An OpenCV CPU-decode path (--decoder opencv) is included as a baseline.

Files

README.md, main.py, prepare_model.py, requirements.txt,
.gitignore, data/peloton_sample_ai_gen.mp4 (1080p H.264 sample), images/result_boxes.jpg.

Test plan

Tested inside rocm/pytorch:rocm7.2.2_ubuntu22.04_py3.10_pytorch_release_2.10.0:

  • python3 prepare_model.py produces model.mxr
  • python3 main.py --decoder rocdecode -> 248 fps end-to-end
  • python3 main.py --decoder opencv -> 195 fps end-to-end

tested on AMD Radeon AI PRO R9700 GPU

@itikhono itikhono requested review from a team as code owners May 11, 2026 10:17
@itikhono
Copy link
Copy Markdown
Author

@ROCm/rocm-examples-owners could you help with reviewing this sample please?

@mapatel-amd mapatel-amd linked an issue May 14, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Collaborator

@zichguan-amd zichguan-amd left a comment

Choose a reason for hiding this comment

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

Thanks, this LGTM. Is this something that we can/want to add to our CI testing?

@itikhono
Copy link
Copy Markdown
Author

Thanks, this LGTM. Is this something that we can/want to add to our CI testing?

I will double check if we can add a new test

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