Restructure runtime tree, add ARIES native cpp build, refresh docs#21
Conversation
Several scripts under compilation/{bert,image_classification,vlm}/
either lacked a `if __name__ == "__main__":` guard or carried lazy
imports inside the guard. Move all imports to module top, wrap top-level
script bodies in the guard, and inline bert/prepare_calib.py's main()
into the guard so the entry-point layout is consistent across tutorials.
Re-runs no longer redownload existing WAVs (skip when wav_path exists), and languages are fetched concurrently via ThreadPoolExecutor exposed through a new `n_workers` argument. Add type hints and English docstrings on the helpers.
Both compile paths use qbcompiler's torch backend and were verified to compile end-to-end on transformers 4.57.1 (bert mblt 100% supported, llm parser 94.66 GOPS / 0 unsupported). Align the pin with vlm so the supported tutorial environment is uniform; stt stays on 4.50.0 because its hf-backend Whisper parser breaks on 4.57.1 with WhisperAttention forward NotImplementedError.
기존 runtime/{bert,llm,...} 와 runtime/cross_compile/ 을 백엔드별로
runtime/python/ 와 runtime/cpp/ 로 재배치.
cwd 가 runtime/python/{task}/ 인 사용자가 명령어를 실행할 때 상대 경로가
한 단계 부족해 ../../compilation/... 이 runtime/compilation 을 가리켜
파일이 안 잡혔다. 한 단계 더 올라가 ../../../compilation/... 으로 바꾸고,
일부 README 의 './{model}.mxq' 가정도 실제 위치인
'../../../compilation/{task}/{model}.mxq' 로 통일.
Python qbruntime 의 사용 단계, REGULUS 사전 설치 안내, 그리고 ARIES 권장 / REGULUS 사용 가능하나 매우 느릴 수 있음을 명시.
Update path references and structure descriptions across root README, SKILLS.md, compilation/*/README, runtime/README, and runtime/cpp/README so they reflect the runtime/python and runtime/cpp directory layout introduced in the previous Refactor commit. (KR) Python/cpp 런타임 디렉토리 분리에 맞춰 최상위 README 정리. 이전 Refactor 커밋에서 도입된 runtime/python 와 runtime/cpp 디렉토리 구조에 맞춰 root README, SKILLS.md, compilation/*/README, runtime/README, runtime/cpp/README 의 경로 표기와 구조 설명을 정리.
…n scripts
After the runtime/{task} -> runtime/python/{task} restructure, all argparse
default paths pointing at compiled artefacts (`--model-path`, `--mxq-path`,
`--audio`, ...) were one level short and resolved to runtime/compilation/...
rather than the actual runtime/../compilation/.... Running any
inference/benchmark/prepare script without explicit arguments failed with
'Failed to load model'. Apply ../../compilation/ -> ../../../compilation/
across all 17 default values so the scripts work from their own directory
out of the box.
(KR) runtime/python 스크립트의 argparse 기본 경로를 한 단계 보정.
runtime/{task} -> runtime/python/{task} 디렉토리 재배치 후, 컴파일 산출물을
가리키던 `--model-path` 등 모든 argparse 기본 경로가 한 단계 부족해
runtime/compilation/... 를 가리켰다. 인자 없이 inference/benchmark/prepare
스크립트를 실행하면 'Failed to load model' 로 실패. 17개 기본값을
../../compilation/ -> ../../../compilation/ 로 일괄 보정해 각 스크립트가
자기 디렉토리에서 인자 없이도 동작하도록 수정.
…ose visualize clip_coords used 2D-style indexing (coords[:, 0] / coords[:, 1]) that, when called from scale_coords_kpts with a (N, 17, 3) keypoint tensor, selected the kpt-axis slot 0 or 1 instead of the trailing x/y channel. As a side effect kpt index 1 (l_eye) had its x coordinate clamped to image height (652) rather than width (980), pulling that keypoint out of its bounding box and producing spurious green skeleton lines that crossed between detections. Switched both clamps to coords[..., 0/1] so any leading shape is handled and only x/y are clipped. draw_boxes computed `tl = 1 or round(0.002 * (h + w) / 2) + 1`, which under Python short-circuit evaluation always returns 1. As a result box thickness and label font scaled with neither image size nor intent. Removed the dead `1 or` so the original expression runs. (KR) pose visualize 의 clip_coords axis 버그와 draw_boxes 두께 단락평가 버그 수정. clip_coords 가 2D 가정 인덱싱 (coords[:, 0] / coords[:, 1]) 을 써서, scale_coords_kpts 에서 (N, 17, 3) keypoint 텐서로 호출되면 마지막 x/y 채널이 아니라 keypoint axis 의 0번/1번 slot 을 잡았다. 부작용으로 kpt 인덱스 1 (l_eye) 의 x 좌표가 image width (980) 가 아니라 height (652) 로 clamp 되어, 그 keypoint 가 박스 밖으로 끌려나가 detection 사이를 가로지르는 가짜 초록 skeleton 선이 그려졌다. coords[..., 0/1] 로 바꿔 임의 leading shape 을 허용하고 x/y 만 clip. draw_boxes 의 `tl = 1 or round(0.002 * (h + w) / 2) + 1` 은 Python 단락 평가에서 항상 1 을 반환해 박스 두께와 라벨 폰트가 이미지 크기와 무관하게 1 px 로 고정됐다. dead 한 `1 or` 를 제거해 원래 식이 실행되도록 정정.
Wire runtime/cpp/rc/ into git so it carries the same cr7.jpg / volcano.jpg sample images as runtime/python/rc/. Split the legacy `!runtime/rc/` gitignore exception into per-backend `!runtime/python/rc/` and `!runtime/cpp/rc/`. Explicitly ignore `output.jpg` inside both rc directories: the inference scripts default their output path next to the input image, so output.jpg is a regenerated artifact and is not referenced from any code or README. (KR) runtime/cpp/rc 의 샘플 이미지 추적, 생성물 output.jpg 는 ignore. runtime/cpp/rc/ 가 runtime/python/rc/ 와 동일한 cr7.jpg / volcano.jpg 샘플 이미지를 담도록 git 추적 대상에 포함. 기존 `!runtime/rc/` gitignore 예외를 백엔드별로 `!runtime/python/rc/` 와 `!runtime/cpp/rc/` 로 분리. 두 rc/ 안의 `output.jpg` 는 추론 스크립트 기본 출력 위치가 입력 이미지 옆이라 매 실행마다 재생성되는 산출물이고 어떤 코드나 README 에서도 참조되지 않으므로 명시 ignore.
Make runtime/cpp/image_classification and runtime/cpp/object_detection
build and run on both ARIES (x86_64 native, NPU on host) and REGULUS
(aarch64 cross-compile, NPU on target board) from the same
CMakeLists.txt. Each CMakeLists now branches on CMAKE_SYSTEM_PROCESSOR
to pick the right `-march` flag, and the model load path passes an
explicit single-core ModelConfig so ARIES multi-mode mxq
(inference_scheme="all" from model_compile.py) loads alongside REGULUS
single-mode mxq. README.{md,KR.md} document the apt OpenCV prereq for
the ARIES path and the two distinct run commands.
In object_detection, also: drop utils/inference/parser.cc and remove
parse_yaml() from the header since the tutorial builds ModelInfo from
hardcoded `make_yolo_detect_config()` and never calls the YAML parser;
rename `parser.h` -> `types.h` so the header reflects its actual role
as a shared type definitions header (PreProcessOps, Task, ImageSize,
PreProcessInfo, PostProcessInfo, ModelInfo); rename `yolov9m_config.h`
-> `yolo_detect_config.h` to reflect that the same config covers both
YOLO11m (ARIES) and YOLOv9m (REGULUS) (ultralytics v8/v9/v11 anchor-free
Detect heads share an output layout of 3 strides x [reg_max*4 box +
nc cls]); and rewrite all file-level and non-obvious inline comments
into bilingual form (English first, then a Korean paragraph or
parenthetical).
(KR) cpp 튜토리얼의 ARIES 네이티브 빌드 지원과 코드 정리.
runtime/cpp/image_classification 와 runtime/cpp/object_detection 가
같은 CMakeLists.txt 로 ARIES (x86_64 네이티브, 호스트 NPU) 와 REGULUS
(aarch64 크로스 컴파일, 보드 NPU) 양쪽에서 빌드·실행되도록 정리.
각 CMakeLists 가 CMAKE_SYSTEM_PROCESSOR 를 분기해 `-march` 를
자동 선택하고, 모델 로드 시 ModelConfig 의 single-core 모드를 명시해
ARIES 의 multi-mode mxq (model_compile.py 의 inference_scheme="all")
와 REGULUS 의 single-mode mxq 가 같은 코드로 로드되도록 함.
README.{md,KR.md} 가 ARIES 경로의 apt OpenCV 사전 설치 명령과 두
실행 명령을 명시.
object_detection 에서는 추가로: 하드코드 `make_yolo_detect_config()`
가 ModelInfo 를 만들어 YAML 파서가 한 번도 호출되지 않으므로
utils/inference/parser.cc 를 삭제하고 헤더에서 parse_yaml() 선언을
제거. `parser.h` 가 실제로는 자료형 헤더 (PreProcessOps, Task,
ImageSize, PreProcessInfo, PostProcessInfo, ModelInfo) 라는 역할에
맞춰 `types.h` 로 rename. `yolov9m_config.h` 는 같은 설정이 YOLO11m
(ARIES) 와 YOLOv9m (REGULUS) 둘 다 적용된다는 사실을 반영해
`yolo_detect_config.h` 로 rename (ultralytics v8/v9/v11 의
anchor-free Detect head 는 3 stride x [reg_max*4 box + nc cls] 출력
layout 을 공유). 모든 파일 헤더와 비명확 inline 주석을 영어/한국어
이중 표기로 통일.
After the runtime/{task} -> runtime/python/{task} restructure several
READMEs still pointed at old paths or used repo-anchored prose like
`mblt-sdk-tutorial/...`. Replace these with proper markdown links to
the same-language target README (English READMEs link to *.md, Korean
READMEs link to *.KR.md). Specifically: rewrite the cross-references
between compilation/llm and runtime/python/llm and between
runtime/python/bert and compilation/bert; update runtime/python/llm,
stt, vlm READMEs that still mentioned the legacy `runtime/llm/`,
`runtime/stt/`, `runtime/vlm/` working directories to
`runtime/python/llm/` etc.; and fix compilation/vlm/README.KR.md
linking into the English runtime README instead of the Korean one.
(KR) 디렉토리 재배치 이후 남아 있던 옛 경로와 repo-anchored 표기 수정.
runtime/{task} -> runtime/python/{task} 디렉토리 재배치 이후에도
일부 README 가 옛 경로나 `mblt-sdk-tutorial/...` 같은 repo-anchored
산문 표기를 남기고 있었다. 이를 같은 언어 README 를 가리키는 markdown
링크 (영어 README 는 *.md, 한국어 README 는 *.KR.md) 로 통일.
구체적으로 compilation/llm 과 runtime/python/llm, runtime/python/bert
와 compilation/bert 간의 상호 참조를 다시 작성하고, runtime/python
의 llm / stt / vlm README 가 `runtime/llm/` `runtime/stt/`
`runtime/vlm/` 등 옛 작업 디렉토리를 가리키던 부분을
`runtime/python/llm/` 등으로 갱신. compilation/vlm/README.KR.md 가
한국어가 아닌 영어 runtime README 로 링크하던 것도 정정.
prepare_model.py downloads yolov12m-face.pt and exports it to yolov12m-face.onnx, and compilation/face_detection/README.md plus runtime/python/face_detection/README.md describe the artefact as yolov12m-face throughout. However the argparse defaults in compilation/face_detection/model_compile.py (--onnx-path, --save-path) and runtime/python/face_detection/inference_mxq.py (--model-path) still pointed at the older yolov11m-face.* names, so invoking either script without explicit arguments failed (model_compile could not find ./yolov11m-face.onnx). Move the three defaults to yolov12m-face so the tutorial works end-to-end with default arguments, matching the actual prepare_model.py output and the README examples. Verified: prepare_model -> prepare_widerface -> `python model_compile.py` (no args) produces yolov12m-face.mxq, and `python inference_mxq.py` (no args) loads it and writes tmp/cr_demo.jpg. (KR) face_detection 스크립트 기본값을 yolov12m-face 명명에 맞춤. prepare_model.py 가 yolov12m-face.pt 를 다운로드해 yolov12m-face.onnx 로 export 하고, compilation/face_detection/README.md 와 runtime/python/face_detection/README.md 도 산출물을 yolov12m-face 로 일관되게 표기한다. 그러나 compilation/face_detection/model_compile.py 의 --onnx-path / --save-path 와 runtime/python/face_detection/inference_mxq.py 의 --model-path 기본값 은 옛 yolov11m-face.* 를 가리키고 있어 두 스크립트를 인자 없이 실행하면 동작하지 않았다 (model_compile 가 ./yolov11m-face.onnx 를 찾지 못함). 세 기본값을 yolov12m-face 로 맞춰 prepare_model.py 실제 산출물 및 README 예시와 일치시키고, 인자 없이도 튜토리얼이 끝까지 실행되도록 정정. 검증: prepare_model -> prepare_widerface -> `python model_compile.py` (인자 없음) 로 yolov12m-face.mxq 생성 및 `python inference_mxq.py` (인자 없음) 로 tmp/cr_demo.jpg 저장 확인.
Three related cleanups across the runtime/ tutorials:
1. runtime/README and runtime/cpp/README still described the cpp
tutorial as REGULUS-cross-compile-only even after the same
CMakeLists started covering both ARIES native and REGULUS
cross-compile flows. Rewrite those sentences to state both flows.
2. runtime/README's Python section bundled driver / runtime-library /
utility installs together. Split it into an ARIES (x86_64 host)
subsection that installs everything and a REGULUS (ARM64 target
board) subsection that documents the preinstalled state and only
needs model-specific Python dependencies.
3. Five KR READMEs (runtime/README.KR.md, runtime/python/{bert,llm,stt,vlm}/README.KR.md)
linked to the English *.md target instead of the matching *.KR.md.
Point them at the same-language target.
4. All docs.mobilint.com links moved from the dead v0.29
installation.html anchors to the live v1.2 pages: driver ->
installing_driver.html, runtime -> installing_runtime_library.html,
utility -> installing_utility.html, model-zoo -> model_zoo.html.
Verified each new URL returns 200.
(KR) runtime README 의 경로 표기, 동언어 링크, 외부 docs URL 정리.
runtime/ 튜토리얼 전반에 걸친 세 가지 관련 정리:
1. runtime/README 와 runtime/cpp/README 가 cpp 튜토리얼을 REGULUS
크로스 컴파일 전용으로 설명하던 부분을 ARIES 네이티브 + REGULUS
크로스 컴파일 두 흐름을 모두 다룬다는 표현으로 갱신.
2. runtime/README 의 Python 섹션이 드라이버 / 런타임 라이브러리 /
유틸리티 설치를 한 덩어리로 묶고 있었던 것을, ARIES (x86_64
호스트) 가 직접 설치하는 흐름과 REGULUS (ARM64 타겟 보드) 가
사전 설치된 상태에서 모델별 Python 종속성만 추가하는 흐름의 두
서브 섹션으로 분리.
3. 5 개의 KR README (runtime/README.KR.md,
runtime/python/{bert,llm,stt,vlm}/README.KR.md) 가 영문 *.md
를 가리키던 링크를 동언어 *.KR.md 로 정정.
4. docs.mobilint.com 의 옛 v0.29 installation.html 앵커가 모두 404
상태였던 것을 v1.2 의 개별 페이지로 일괄 교체: 드라이버 ->
installing_driver.html, 런타임 라이브러리 ->
installing_runtime_library.html, 유틸리티 ->
installing_utility.html, model-zoo -> model_zoo.html.
교체한 URL 모두 200 응답 확인.
runtime/python/README.{md,KR.md} also referenced the dead v0.29
installation.html anchor for the driver guide. Move it to the live
v1.2 installing_driver.html page so the runtime overview matches the
URL set in runtime/README.{md,KR.md}. Verified the target returns 200.
(KR) runtime/python 개요 README 의 docs.mobilint URL 갱신.
runtime/python/README.{md,KR.md} 의 드라이버 가이드 링크도 옛
v0.29 installation.html 앵커를 가리키고 있었다. v1.2 의
installing_driver.html 로 옮겨 runtime/README.{md,KR.md} 의 URL
세트와 통일. 새 URL 200 응답 확인 완료.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e37b28eb4e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The host-arch branch in runtime/cpp/{image_classification,object_detection}/CMakeLists.txt
keys off CMAKE_SYSTEM_PROCESSOR, which cmake only populates when the
toolchain file is actually applied. The Mobilint REGULUS SDK
(`environment-setup-cortexa53-mobilint-linux` + the bundled
`environment-setup.d/cmake.sh`) exports CMAKE_TOOLCHAIN_FILE as an
environment variable rather than passing -DCMAKE_TOOLCHAIN_FILE on the
command line. cmake auto-detects that environment variable starting
with 3.21 (see the 3.21 release notes: "the toolchain file is now also
read from a CMAKE_TOOLCHAIN_FILE environment variable if no toolchain
file has otherwise been specified"). On cmake 3.18-3.20 the variable
is ignored, the toolchain file is never sourced, CMAKE_SYSTEM_PROCESSOR
stays at the host's x86_64, and the if/else branch hands the aarch64
cross-compiler a `-march=native` it cannot satisfy. Raising the minimum
to 3.21 makes the documented "source SDK env, then cmake -B build -S ."
flow safe on every reasonable host (Ubuntu 22.04 ships cmake 3.22.1).
(KR) runtime/cpp 튜토리얼의 cmake_minimum_required 를 3.21 로 상향.
runtime/cpp/{image_classification,object_detection}/CMakeLists.txt 의
호스트 arch 분기는 CMAKE_SYSTEM_PROCESSOR 를 본다. 이 변수는 cmake 가
toolchain file 을 실제 적용했을 때만 채워진다. Mobilint REGULUS SDK
의 `environment-setup-cortexa53-mobilint-linux` 와 동봉
`environment-setup.d/cmake.sh` 는 CMAKE_TOOLCHAIN_FILE 을 명령줄
인자가 아니라 환경 변수로 export 한다. cmake 가 환경 변수
CMAKE_TOOLCHAIN_FILE 를 자동 인식하는 것은 3.21 이후이다
(3.21 release notes: "the toolchain file is now also read from a
CMAKE_TOOLCHAIN_FILE environment variable if no toolchain file has
otherwise been specified"). cmake 3.18~3.20 환경에서는 이 변수가
무시되어 toolchain file 이 적용되지 않고, CMAKE_SYSTEM_PROCESSOR 가
호스트의 x86_64 그대로 남아 if/else 분기가 aarch64 크로스 컴파일러에
`-march=native` 를 넘기는 실패가 발생한다. 최소 버전을 3.21 로 올려
문서화된 "SDK 환경 source 후 cmake -B build -S ." 흐름이 모든
상식적 호스트에서 안전하도록 정정한다 (Ubuntu 22.04 의 표준 cmake
패키지는 3.22.1).
|
@mobilint-review review aware
|
There was a problem hiding this comment.
Codex review
Requested by @khh0303.
Verdict
The CMake-side contract described in the request is reflected in the checked-out files: both C++ tutorial CMakeLists.txt files now require CMake 3.21 and branch on CMAKE_SYSTEM_PROCESSOR for aarch64|arm64. I found one documentation inconsistency: the adjacent prerequisites still advertise CMake 3.18, which now conflicts with the enforced minimum and the reliance on CMake 3.21 environment-based CMAKE_TOOLCHAIN_FILE detection.
Suggested next steps
- Change the CMake prerequisite from 3.18 to 3.21 in both English C++ tutorial READMEs.
- Make the same 3.21 prerequisite update in the matching Korean READMEs to keep the bilingual docs synchronized.
Trigger: issue_comment
Source: #21 (comment)
The two C++ tutorial CMakeLists.txt now require CMake 3.21 because the
REGULUS flow relies on cmake auto-detecting the CMAKE_TOOLCHAIN_FILE
environment variable, which only works on cmake 3.21 and newer. The
prerequisites sections in the four cpp tutorial READMEs
(runtime/cpp/{image_classification,object_detection}/README.{md,KR.md})
still listed `CMake >= 3.18`, so users on 3.18-3.20 could follow the
docs verbatim and either hit the new minimum-version error or silently
skip the SDK toolchain. Update each prerequisite line to
`CMake >= 3.21` so the documented requirement matches what the build
files actually enforce.
(KR) cpp 튜토리얼의 README CMake 요구 버전을 3.21 로 상향.
두 C++ 튜토리얼의 CMakeLists.txt 가 CMake 3.21 을 요구하도록 올라간
이유는 REGULUS 흐름이 cmake 의 환경 변수 CMAKE_TOOLCHAIN_FILE 자동
인식에 의존하기 때문이고, 이 자동 인식은 cmake 3.21 이후에만
동작한다. 그런데 네 cpp 튜토리얼 README
(runtime/cpp/{image_classification,object_detection}/README.{md,KR.md})
의 prerequisites 섹션이 여전히 `CMake >= 3.18` 로 적혀 있어, 3.18~
3.20 사용자가 문서대로 따라하면 (a) 새 minimum-version 에러를 보거나
(b) SDK toolchain 적용이 조용히 건너뛰어진다. 네 README 의 해당 줄을
모두 `CMake >= 3.21` 로 갱신해 문서가 build file 의 실제 요구와
일치하도록 정정.
This comment was marked as outdated.
This comment was marked as outdated.
|
@mobilint-review review |
|
🤖 Received @mobilint-review. The self-hosted Codex agent is responding now. |
There was a problem hiding this comment.
Codex review
Requested by @khh0303.
Verdict
Reviewed the PR for regressions in the restructured runtime docs and new C++ build flow. I found issues in the REGULUS setup/build path that can make the documented C++ tutorials fail before users reach inference.
Suggested next steps
- Align all REGULUS toolchain source paths across
runtime/cpp/README*.mdand per-example READMEs. - Update both C++ tutorial CMake files to select ARM flags from the actual target/toolchain, then verify the documented ARIES and REGULUS build commands.
Trigger: issue_comment
Source: #21 (comment)
…DMEs
The Mobilint REGULUS SDK installs the toolchain under two levels:
`/opt/crosstools/mobilint/{version}/{sdk}/...` (e.g.
`/opt/crosstools/mobilint/1.0.0/v3.4.0/environment-setup-cortexa53-mobilint-linux`,
as confirmed by the installer's DEFAULT_INSTALL_DIR and the archive
layout). The per-example C++ READMEs already documented the two-level
form, but `runtime/cpp/README.{md,KR.md}` showed only
`/opt/crosstools/mobilint/{version}/environment-setup-cortexa53-mobilint-linux`,
so users following the top-level setup sourced a path that does not
exist. Align the top-level READMEs with the per-example form so all
four files agree on `{version}/{sdk}/`.
(KR) top-level cpp README 의 SDK source 경로를 per-example README 와 통일.
Mobilint REGULUS SDK 는 toolchain 을
`/opt/crosstools/mobilint/{version}/{sdk}/...` 두 단계 경로 (예:
`/opt/crosstools/mobilint/1.0.0/v3.4.0/environment-setup-cortexa53-mobilint-linux`,
installer 의 DEFAULT_INSTALL_DIR 및 archive 구조로 확인) 에 설치한다.
per-example cpp README 는 이미 두 단계 표기로 문서화돼 있었지만
`runtime/cpp/README.{md,KR.md}` 는 한 단계만 (`{version}/environment-setup-...`)
로 적혀 있어, top-level 설정을 그대로 따른 사용자가 존재하지 않는
경로를 source 하게 됐다. top-level README 를 per-example 표기와
맞춰 네 README 모두 `{version}/{sdk}/` 로 통일.
|
@mobilint-review review |
|
🤖 Received @mobilint-review. The self-hosted Codex agent is responding now. |
There was a problem hiding this comment.
Codex review
Requested by @khh0303.
Verdict
The PR mostly keeps the runtime tree and bilingual docs aligned, but I found a C++ decoder robustness issue and a stale C++ comment that conflicts with the new ARIES-native support claim.
Suggested next steps
- Add a decode-time check that the staged YOLO outputs cover every expected stride before populating or reading
access. - Refresh the C++ runner comments to describe both ARIES native and REGULUS target execution accurately.
Trigger: issue_comment
Source: #21 (comment)
…ARIES + REGULUS Two follow-ups from review. 1) runtime/cpp/object_detection/utils/postprocess/decode.cc: stage_outputs() only checks that the det and cls tensor counts match each other, so a partial NPU output (one stride pair missing) would leave the trailing slots of `access` uninitialized while the pre-filter loop still walks all `total_anchors` entries -> undefined behaviour. Our current mxq never produces a partial output, but the invariant was implicit. Throw a std::runtime_error before the pre-filter loop if `anchor_idx != total_anchors`, so the assumption is captured in code. 2) runtime/cpp/object_detection/utils/inference/runner.h: The file header still said NPU access was only available on the target ARM64 board and that host builds would link-fail on qbruntime symbols, which contradicts the ARIES x86_64 native build path this PR adds. Rewrite the header to describe both supported execution paths (ARIES native + REGULUS cross-compile) so readers of the example source get an accurate picture. (KR) staged anchor 적용 범위 검증과 runner.h 헤더 갱신. 리뷰 후속 두 가지. 1) runtime/cpp/object_detection/utils/postprocess/decode.cc: stage_outputs() 가 det/cls 텐서 개수 일치만 검사한다. 그래서 한 stride 쌍이 빠진 부분 NPU 출력이 들어오면 `access` 의 뒤쪽 슬롯이 초기화되지 않은 채로 pre-filter loop 가 `total_anchors` 전체를 순회해 UB 가 된다. 현재 mxq 가 부분 출력을 내지는 않지만 이 invariant 가 코드에 명시돼 있지 않았다. pre-filter loop 직전에 `anchor_idx != total_anchors` 면 `std::runtime_error` 를 던지도록 가드를 추가해 가정을 코드에 못 박는다. 2) runtime/cpp/object_detection/utils/inference/runner.h: 파일 헤더가 "NPU 접근은 ARM64 보드 전용이고 host 빌드는 qbruntime 심볼 에서 링크 오류" 라고 적혀 있었는데, 이 PR 이 추가한 ARIES x86_64 네이 티브 빌드 경로와 모순이다. ARIES 네이티브와 REGULUS 크로스 컴파일 두 실행 경로를 정확히 묘사하도록 헤더를 다시 적어 예제 소스를 읽는 사용 자에게 올바른 정보를 준다.
|
@mobilint-review review |
|
🤖 Received @mobilint-review. The self-hosted Codex agent is responding now. |
There was a problem hiding this comment.
Codex review
Requested by @khh0303.
Verdict
I reviewed the PR update in summary mode and found one concrete build portability issue in the new C++ object detection path. The rest of the restructure did not show another supportable inline finding from the available diff assets.
Suggested next steps
- Add the missing
<limits>include inruntime/cpp/object_detection/utils/postprocess/decode.cc. - Re-check the C++ object detection build after that change, especially with the REGULUS cross toolchain.
Trigger: issue_comment
Source: #21 (comment)
decode.cc calls std::numeric_limits<float>::infinity() but only relies on transitive inclusion through other STL headers, which is not guaranteed by the standard. The host build (libstdc++ 12) currently picks the symbol up indirectly, but a different toolchain - for example the REGULUS Yocto SDK's libstdc++ - may not pull <limits> through <vector> and the file would fail to compile. Add an explicit `#include <limits>` so YoloDecoder builds on every supported toolchain (ARIES x86_64 native and REGULUS aarch64 cross). (KR) object_detection decode.cc 에 빠져 있던 <limits> include 추가. decode.cc 가 std::numeric_limits<float>::infinity() 를 사용하는데 다른 STL 헤더를 통한 transitive include 에만 의존하고 있었고, 이는 표준이 보장하지 않는다. 호스트 빌드 (libstdc++ 12) 에서는 우연히 빌드되지만, 예컨대 REGULUS Yocto SDK 의 다른 libstdc++ 버전에서는 <vector> 가 <limits> 를 끌어오지 않아 컴파일이 실패할 수 있다. `#include <limits>` 를 명시 추가해 ARIES x86_64 네이티브와 REGULUS aarch64 크로스 두 지원 툴체인 모두에서 YoloDecoder 가 안전하게 빌드되도록 정정.
runtime/cross_compile/).
and REGULUS (aarch64 cross-compile) from the same CMakeLists.txt (host-arch branched -march, explicit
single-core ModelConfig).
behind.
utility, model-zoo).
runtime/cpp/object_detection dead-YAML-parser cleanup and bilingual comments.
runtime/cross_compile/).
와 REGULUS (aarch64 크로스 컴파일) 모두에서 빌드·실행 (호스트 arch 분기 -march, single-core ModelConfig
명시).
유틸리티, model-zoo).
의 사용되지 않는 YAML 파서 제거 + 주석 영/한 병기.