[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7964X10JBJX565CTB94G2Y8":3,"skill-same:01M7964X10JBJX565CTB94G2Y8":70},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":32,"install":33,"resources":45},"01M7964X10JBJX565CTB94G2Y8","engine-building",null,"Build and diagnose TensorRT engines for the repository's Caffe GoogLeNet and MTCNN, TensorFlow UFF SSD, DarkNet YOLO, and ONNX MODNet workflows, including the legacy API boundaries, custom plugin, FP16\u002FINT8 calibration, and Jetson DLA paths.","VectorSpaceLab\u002FAREX-Skill","VectorSpaceLab","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F180637102?v=4","01M7538C5WPSJGWF7KHR4EFZ9F","01M7538C6R2GFP53NPXTCZNBRT",351,"MIT","https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Frepositories\u002Frepo-skills\u002Ftensorrt-demos\u002Fsub-skills\u002Fengine-building\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: \"engine-building\"\ndescription: \"Build and diagnose TensorRT engines for the repository's Caffe\n  GoogLeNet and MTCNN, TensorFlow UFF SSD, DarkNet YOLO, and ONNX MODNet\n  workflows, including the legacy API boundaries, custom plugin, FP16\u002FINT8\n  calibration, and Jetson DLA paths.\"\ndisable-model-invocation: true\nmetadata:\n  disco-role: operating\nlicense: MIT\n---\n\n# TensorRT engine building\n\nUse this sub-skill when a Researcher needs to **prepare inputs, choose a\nversion-compatible path, or build\u002Finspect** one of the engines in this\nrepository. It is an operating guide, not a promise that a serialized engine\nis portable: TensorRT engines and custom CUDA plugins are tied to the TensorRT,\nCUDA, driver, GPU architecture, and sometimes OS\u002Fruntime that built them.\n\n## Safety and decision gate\n\n- This skill is intentionally **non-mutating by default**. Reading files,\n  `--help`, `scripts\u002Fvalidate-engine-build-inputs.py`, and\n  `scripts\u002Fcheck_cuda_arch.py` do not build, download, install, create symlinks,\n  patch system packages, or overwrite engines.\n- Building is an explicit action. Before it, confirm the target TensorRT major\n  version, CUDA\u002Ftoolkit and driver availability, GPU compute capability, model\n  artifact provenance, output paths, and whether an existing engine may be\n  replaced.\n- Do not run `yolo\u002Fdownload_yolo.sh`, `ssd\u002Finstall.sh`, `*\u002Finstall_pycuda.sh`,\n  or the README's `wget`, `apt`, `pip`, `ln -s`, `patch`, and `sudo` commands as\n  an implicit prerequisite. Acquire or install dependencies through the\n  operator's approved, isolated process and record versions.\n- Prefer a new output filename or a clean, dedicated build directory. Never\n  use a source checkout as a scratch area without an explicit overwrite plan.\n- Use `--verbose`\u002F`-v` only when diagnosing; it can expose useful parser and\n  tactic errors but does not make an unsupported API compatible.\n\n## Choose the workflow\n\n| Input\u002Fmodel family | Repository entry point | Outputs and fixed facts |\n|---|---|---|\n| Caffe GoogLeNet | `googlenet\u002FMakefile`, `googlenet\u002Fcreate_engine.cpp` | `deploy.engine`; parses `deploy.prototxt` + `deploy.caffemodel`, marks `prob`, max batch 1, deserializes and expects 2 bindings |\n| Caffe MTCNN | `mtcnn\u002FMakefile`, `mtcnn\u002Fcreate_engines.cpp` | `det1.engine`, `det2.engine`, `det3.engine`; uses the `_relu` prototxt\u002Fmodel pairs and max batches PNet 1, RNet 256, ONet 64 |\n| TensorFlow frozen graph → UFF SSD | `ssd\u002Fbuild_engine.py`, `ssd\u002Fbuild_engines.sh` | `TRT_\u003Cmodel>.bin` (temporary `\u003Cmodel>.uff`); fixed input `(3,300,300)`, `Input`, `NMS`; legacy TensorFlow\u002FUFF\u002FGraphSurgeon plus FlattenConcat plugin |\n| DarkNet YOLO → ONNX → TensorRT | `yolo\u002Fyolo_to_onnx.py`, `yolo\u002Fonnx_to_tensorrt.py` | `\u003Cmodel>.onnx`, then `\u003Cmodel>.trt`; uses cfg-derived shape\u002Fclasses\u002Fanchors and the `YoloLayer_TRT` plugin, final output `detections` |\n| YOLO reduced precision \u002F accelerator | `yolo\u002Fonnx_to_tensorrt.py`, `build_int8_engines.sh`, `build_dla_engines.sh` | INT8 uses `calib_images\u002F` and `calib_\u003Cmodel>.bin`; DLA names use `--dla_core`; both are explicit variants, not defaults |\n| ONNX MODNet → TensorRT | `modnet\u002Fonnx_to_tensorrt.py` | `python3 onnx_to_tensorrt.py [options] input.onnx output.engine`; fixed batch 1, default profile `(1,3,480,640)`, FP16 + GPU fallback; source explicitly raises for INT8 and DLA |\n\nFor detailed command sequences and artifact checks, read\n[references\u002Fworkflows.md](references\u002Fworkflows.md). For version\u002FAPI and\nhardware gates, read [compatibility.md](compatibility.md). For failures, read\n[references\u002Ftroubleshooting.md](references\u002Ftroubleshooting.md).\n\n## Common preflight\n\n1. Identify the actual `python3`, `nvcc`, TensorRT Python package, TensorRT\n   headers\u002Flibraries, CUDA driver, and GPU. Do not infer them from a path in\n   this checkout. `plugins\u002Fgpu_cc.py` is a useful native CUDA probe; the\n   bundled `scripts\u002Fcheck_cuda_arch.py` is a dependency-free diagnostic and\n   does not build anything.\n2. Run the safe validator against a **read-only** source tree or an explicit\n   build-input directory:\n\n   ```shell\n   python3 scripts\u002Fvalidate-engine-build-inputs.py --repo-root . --all\n   ```\n\n   Add `--model \u003Cname>` for a model-specific report. It checks presence,\n   regular-file\u002Fsymlink status, YOLO cfg shape invariants, calibration image\n   count, plugin\u002Fsource preconditions, and warns on missing optional inputs.\n3. Confirm paths and expected names before invoking any builder. A successful\n   preflight only proves that inputs are plausible; it does not parse a model,\n   compile a plugin, or validate TensorRT execution.\n4. Build the custom plugin before YOLO conversion, then verify that the shared\n   object is loadable in the same runtime that imports `yolo\u002Fplugins.py`. The\n   plugin must be compiled for every target GPU architecture or a compatible\n   PTX path, and its TensorRT ABI must match the builder\u002Fruntime.\n5. After each build, verify the output exists, is non-empty, can be deserialized\n   by the **same** TensorRT major\u002Fminor family, and has the expected bindings or\n   I\u002FO names. For accuracy-sensitive detection changes, compare FP32\u002FFP16\u002FINT8\n   outputs or mAP; speed alone is not validation.\n\n## Engine-specific operating rules\n\n### Caffe: GoogLeNet and MTCNN\n\n- Build from the respective directory so `locateFile()` and relative model\n  paths resolve. `make` compiles against `common\u002FMakefile.config`; check\n  `TARGET`, `CUDA_INSTALL_DIR`, `CUDNN_INSTALL_DIR`, TensorRT include paths,\n  and libraries before compilation.\n- GoogLeNet parses `deploy.prototxt` and `deploy.caffemodel`, marks `prob`,\n  selects FP16 when `platformHasFastFp16()` is true, writes `deploy.engine`,\n  then immediately deserializes it and prints two bindings.\n- MTCNN uses the repository's `det1_relu`, `det2_relu`, and `det3_relu` files;\n  the `_relu` conversion is deliberate because the README documents the\n  TensorRT 3\u002F4 PReLU workaround. Outputs are `prob1` plus box\u002Flandmark heads:\n  PNet `prob1,conv4-2`, RNet `prob1,conv5-2`, ONet `prob1,conv6-2,conv6-3`.\n  The executable checks 3, 3, and 4 bindings respectively.\n- These C++ programs contain both legacy and newer branches, but are not\n  generic modern TensorRT samples. Treat Caffe parser availability and\n  deprecated `destroy()`\u002Fimplicit-batch APIs as version gates, not as advice\n  to mechanically port every line.\n\n### TensorFlow UFF SSD\n\n- Select one of the model keys declared in `ssd\u002Fbuild_engine.py` (the build\n  shell script covers four v1\u002Fv2 COCO\u002FEgoHands models; the Python map also\n  documents Inception and SSDLite variants). Run from `ssd\u002F` so all paths and\n  `libflattenconcat.so` resolution are predictable.\n- The script rewrites graph namespaces into `GridAnchor_TRT`, `NMS_TRT`, and\n  `FlattenConcat_TRT`, replaces unsupported `AddV2` and `FusedBatchNormV3`,\n  removes assertions\u002Fidentities, and registers `Input` `(1,3,300,300)` and\n  `MarkOutput_0`. It uses FP16 and a 256 MiB legacy workspace setting.\n- UFF was tested by the repository with TensorFlow 1.12.x\u002Fcompatible UFF (the\n  README explicitly says other versions are not guaranteed). This is a legacy\n  path. Do not substitute a current TensorFlow\u002FUFF stack without an isolated\n  compatibility test and do not assume an old `.bin` can be deserialized by a\n  modern runtime.\n- Confirm the `libflattenconcat.so` symlink\u002FSONAME matches TensorRT 5 or 6 as\n  applicable. The README records a TensorRT 6 plugin-creator registration\n  warning; distinguish a harmless duplicate registration warning from a real\n  missing creator or parse failure.\n\n### DarkNet YOLO → ONNX → TensorRT\n\n- Obtain a cfg and matching DarkNet weights through an approved source. The\n  conversion script derives classes, anchor masks, input `height\u002Fwidth`, and\n  output heads from the cfg; it expects `\u003Cmodel>.cfg` and `\u003Cmodel>.weights` in\n  its working directory and writes `\u003Cmodel>.onnx`.\n- Run `python3 yolo\u002Fyolo_to_onnx.py --help` to confirm the CLI in the active\n  environment, then use `-m \u003Cmodel>` only after the matching cfg\u002Fweights have\n  been validated. The supported naming convention is an architecture plus a\n  dimension, such as `yolov4-416` or `yolov4-416x256`; custom classes require\n  a matching cfg and postprocessing expectations.\n- Build `plugins\u002Flibyolo_layer.so` before the TensorRT step. The Python module\n  loads it using a path relative to the `yolo\u002F` working directory, initializes\n  TensorRT's plugin registry, looks up `YoloLayer_TRT`, replaces each raw YOLO\n  output, and concatenates them as `detections`. The plugin accepts linear\n  FLOAT tensors only; it is not an FP16 plugin implementation merely because\n  the rest of the builder sets an FP16 flag.\n- Run `python3 yolo\u002Fonnx_to_tensorrt.py -m \u003Cmodel>` for the repository's\n  baseline FP16 path. The script forces batch 1, uses a 1 GiB workspace,\n  creates a fixed optimization profile for the cfg shape, and serializes\n  `\u003Cmodel>.trt`. TensorRT 7–9 and 10+ use different branches in this checkout;\n  inspect the version-specific warnings in `compatibility.md` before running.\n- Do not call the download script as part of a routine build. It downloads\n  several large DarkNet artifacts and creates derivative cfgs\u002Fsymlinks; use it\n  only as an explicit, reviewed acquisition step.\n\n### YOLO FP16, INT8 calibration, and DLA\n\n- FP16 is the default selected builder mode in the legacy YOLO, GoogLeNet, and\n  MTCNN implementations when supported. Check `platform_has_fast_fp16` or the\n  corresponding modern capability before claiming a true FP16 build.\n- INT8 requires a platform with fast INT8 support and a representative image\n  set. The repository calibrator reads `.jpg` files from `calib_images\u002F`,\n  resizes BGR→RGB to the cfg shape, transposes to CHW, scales to `[0,1]`, uses\n  batch 1, and caches at `calib_\u003Cmodel>.bin`. The README suggests 500 images\n  and demonstrates 1,000 COCO `val2017` images; this is guidance, not a proof\n  of sufficient coverage for another deployment distribution.\n- Check calibration image readability, ordering\u002Freproducibility, class and\n  scene coverage, cache ownership, and whether the cache corresponds to the\n  exact model\u002Finput\u002Fpreprocessing. Delete or quarantine a stale cache only\n  after an explicit decision. INT8 can alter accuracy: the repository reports\n  an unresolved poor mAP result for YOLOv4-608 INT8, so always evaluate.\n- DLA is an optional Jetson Xavier\u002FNX-era path. The YOLO builder sets default\n  device DLA, selects `DLA_core`, enables GPU fallback in its TensorRT 7\u002F8\n  branch, and uses strict types; the TensorRT 3–6 branch rejects DLA. DLA\n  engine creation is not evidence that inference used the requested core.\n  TensorRT 7.1's Python API in the repository could not explicitly select the\n  inference core after deserialization. Verify device placement with the\n  target runtime's supported API and treat unsupported layers\u002Ffallback as\n  expected failure modes. The README specifically records `yolov4-tiny-416`\n  DLA build failure in the historical test.\n\n### MODNet ONNX → TensorRT\n\n- Use the checked-in `modnet\u002Fmodnet.onnx` or another approved ONNX with the\n  same input contract. The converter requires TensorRT 7+ and sets an explicit\n  batch network, batch 1, a named `Input` profile, FP16, GPU fallback, and a\n  1 GiB workspace. Defaults are width 640 and height 480; override both\n  together when the model and caller agree.\n- Invoke `python3 modnet\u002Fonnx_to_tensorrt.py --help` first, then provide\n  `input_onnx output_engine`. The repository implementation deliberately\n  raises `INT8 not implemented yet` and `DLA_core not implemented yet`; do\n  not document those flags as working MODNet features.\n- TensorRT 7.1 needs the documented private onnx-tensorrt workaround for\n  dynamic `InstanceNormalization`; TensorRT 7.2 fixed the issue according to\n  the README. Treat the uninitialized `modnet\u002Fonnx-tensorrt\u002F` submodule as\n  third-party build material, not as a bundled dependency. Prefer TensorRT\n  7.2+ for the direct converter after checking ONNX input dimensions.\n- Verify the resulting engine with `trt_modnet.py --help` or a controlled\n  headless inference harness. The README's demo expects `modnet\u002Fimage.jpg`,\n  but display\u002Fvideo tests are separate from engine creation.\n\n## Completion and handoff\n\nRecord, for each engine: source artifact hashes or provenance, TensorRT\u002FCUDA\u002F\nGPU versions, exact command and working directory, plugin and calibration\ninputs, output path, warnings, deserialization\u002Fbinding check, and accuracy or\nruntime result. Mark a path **blocked** rather than silently falling back when\nits required backend, legacy parser, custom plugin, calibration data, or DLA\nhardware is unavailable. A partial static\u002Fhelp-only check is not a successful\nengine build.\n","# TensorRT engine building\n\nUse this sub-skill when a Researcher needs to **prepare inputs, choose a\nversion-compatible path, or build\u002Finspect** one of the engines in this\nrepository. It is an operating guide, not a promise that a serialized engine\nis portable: TensorRT engines and custom CUDA plugins are tied to the TensorRT,\nCUDA, driver, GPU architecture, and sometimes OS\u002Fruntime that built them.\n\n## Safety and decision gate\n\n- This skill is intentionally **non-mutating by default**. Reading files,\n  `--help`, `scripts\u002Fvalidate-engine-build-inputs.py`, and\n  `scripts\u002Fcheck_cuda_arch.py` do not build, download, install, create symlinks,\n  patch system packages, or overwrite engines.\n- Building is an explicit action. Before it, confirm the target TensorRT major\n  version, CUDA\u002Ftoolkit and driver availability, GPU compute capability, model\n  artifact provenance, output paths, and whether an existing engine may be\n  replaced.\n- Do not run `yolo\u002Fdownload_yolo.sh`, `ssd\u002Finstall.sh`, `*\u002Finstall_pycuda.sh`,\n  or the README's `wget`, `apt`, `pip`, `ln -s`, `patch`, and `sudo` commands as\n  an implicit prerequisite. Acquire or install dependencies through the\n  operator's approved, isolated process and record versions.\n- Prefer a new output filename or a clean, dedicated build directory. Never\n  use a source checkout as a scratch area without an explicit overwrite plan.\n- Use `--verbose`\u002F`-v` only when diagnosing; it can expose useful parser and\n  tactic errors but does not make an unsupported API compatible.\n\n## Choose the workflow\n\n| Input\u002Fmodel family | Repository entry point | Outputs and fixed facts |\n|---|---|---|\n| Caffe GoogLeNet | `googlenet\u002FMakefile`, `googlenet\u002Fcreate_engine.cpp` | `deploy.engine`; parses `deploy.prototxt` + `deploy.caffemodel`, marks `prob`, max batch 1, deserializes and expects 2 bindings |\n| Caffe MTCNN | `mtcnn\u002FMakefile`, `mtcnn\u002Fcreate_engines.cpp` | `det1.engine`, `det2.engine`, `det3.engine`; uses the `_relu` prototxt\u002Fmodel pairs and max batches PNet 1, RNet 256, ONet 64 |\n| TensorFlow frozen graph → UFF SSD | `ssd\u002Fbuild_engine.py`, `ssd\u002Fbuild_engines.sh` | `TRT_\u003Cmodel>.bin` (temporary `\u003Cmodel>.uff`); fixed input `(3,300,300)`, `Input`, `NMS`; legacy TensorFlow\u002FUFF\u002FGraphSurgeon plus FlattenConcat plugin |\n| DarkNet YOLO → ONNX → TensorRT | `yolo\u002Fyolo_to_onnx.py`, `yolo\u002Fonnx_to_tensorrt.py` | `\u003Cmodel>.onnx`, then `\u003Cmodel>.trt`; uses cfg-derived shape\u002Fclasses\u002Fanchors and the `YoloLayer_TRT` plugin, final output `detections` |\n| YOLO reduced precision \u002F accelerator | `yolo\u002Fonnx_to_tensorrt.py`, `build_int8_engines.sh`, `build_dla_engines.sh` | INT8 uses `calib_images\u002F` and `calib_\u003Cmodel>.bin`; DLA names use `--dla_core`; both are explicit variants, not defaults |\n| ONNX MODNet → TensorRT | `modnet\u002Fonnx_to_tensorrt.py` | `python3 onnx_to_tensorrt.py [options] input.onnx output.engine`; fixed batch 1, default profile `(1,3,480,640)`, FP16 + GPU fallback; source explicitly raises for INT8 and DLA |\n\nFor detailed command sequences and artifact checks, read\n[references\u002Fworkflows.md](references\u002Fworkflows.md). For version\u002FAPI and\nhardware gates, read [compatibility.md](compatibility.md). For failures, read\n[references\u002Ftroubleshooting.md](references\u002Ftroubleshooting.md).\n\n## Common preflight\n\n1. Identify the actual `python3`, `nvcc`, TensorRT Python package, TensorRT\n   headers\u002Flibraries, CUDA driver, and GPU. Do not infer them from a path in\n   this checkout. `plugins\u002Fgpu_cc.py` is a useful native CUDA probe; the\n   bundled `scripts\u002Fcheck_cuda_arch.py` is a dependency-free diagnostic and\n   does not build anything.\n2. Run the safe validator against a **read-only** source tree or an explicit\n   build-input directory:\n\n   ```shell\n   python3 scripts\u002Fvalidate-engine-build-inputs.py --repo-root . --all\n   ```\n\n   Add `--model \u003Cname>` for a model-specific report. It checks presence,\n   regular-file\u002Fsymlink status, YOLO cfg shape invariants, calibration image\n   count, plugin\u002Fsource preconditions, and warns on missing optional inputs.\n3. Confirm paths and expected names before invoking any builder. A successful\n   preflight only proves that inputs are plausible; it does not parse a model,\n   compile a plugin, or validate TensorRT execution.\n4. Build the custom plugin before YOLO conversion, then verify that the shared\n   object is loadable in the same runtime that imports `yolo\u002Fplugins.py`. The\n   plugin must be compiled for every target GPU architecture or a compatible\n   PTX path, and its TensorRT ABI must match the builder\u002Fruntime.\n5. After each build, verify the output exists, is non-empty, can be deserialized\n   by the **same** TensorRT major\u002Fminor family, and has the expected bindings or\n   I\u002FO names. For accuracy-sensitive detection changes, compare FP32\u002FFP16\u002FINT8\n   outputs or mAP; speed alone is not validation.\n\n## Engine-specific operating rules\n\n### Caffe: GoogLeNet and MTCNN\n\n- Build from the respective directory so `locateFile()` and relative model\n  paths resolve. `make` compiles against `common\u002FMakefile.config`; check\n  `TARGET`, `CUDA_INSTALL_DIR`, `CUDNN_INSTALL_DIR`, TensorRT include paths,\n  and libraries before compilation.\n- GoogLeNet parses `deploy.prototxt` and `deploy.caffemodel`, marks `prob`,\n  selects FP16 when `platformHasFastFp16()` is true, writes `deploy.engine`,\n  then immediately deserializes it and prints two bindings.\n- MTCNN uses the repository's `det1_relu`, `det2_relu`, and `det3_relu` files;\n  the `_relu` conversion is deliberate because the README documents the\n  TensorRT 3\u002F4 PReLU workaround. Outputs are `prob1` plus box\u002Flandmark heads:\n  PNet `prob1,conv4-2`, RNet `prob1,conv5-2`, ONet `prob1,conv6-2,conv6-3`.\n  The executable checks 3, 3, and 4 bindings respectively.\n- These C++ programs contain both legacy and newer branches, but are not\n  generic modern TensorRT samples. Treat Caffe parser availability and\n  deprecated `destroy()`\u002Fimplicit-batch APIs as version gates, not as advice\n  to mechanically port every line.\n\n### TensorFlow UFF SSD\n\n- Select one of the model keys declared in `ssd\u002Fbuild_engine.py` (the build\n  shell script covers four v1\u002Fv2 COCO\u002FEgoHands models; the Python map also\n  documents Inception and SSDLite variants). Run from `ssd\u002F` so all paths and\n  `libflattenconcat.so` resolution are predictable.\n- The script rewrites graph namespaces into `GridAnchor_TRT`, `NMS_TRT`, and\n  `FlattenConcat_TRT`, replaces unsupported `AddV2` and `FusedBatchNormV3`,\n  removes assertions\u002Fidentities, and registers `Input` `(1,3,300,300)` and\n  `MarkOutput_0`. It uses FP16 and a 256 MiB legacy workspace setting.\n- UFF was tested by the repository with TensorFlow 1.12.x\u002Fcompatible UFF (the\n  README explicitly says other versions are not guaranteed). This is a legacy\n  path. Do not substitute a current TensorFlow\u002FUFF stack without an isolated\n  compatibility test and do not assume an old `.bin` can be deserialized by a\n  modern runtime.\n- Confirm the `libflattenconcat.so` symlink\u002FSONAME matches TensorRT 5 or 6 as\n  applicable. The README records a TensorRT 6 plugin-creator registration\n  warning; distinguish a harmless duplicate registration warning from a real\n  missing creator or parse failure.\n\n### DarkNet YOLO → ONNX → TensorRT\n\n- Obtain a cfg and matching DarkNet weights through an approved source. The\n  conversion script derives classes, anchor masks, input `height\u002Fwidth`, and\n  output heads from the cfg; it expects `\u003Cmodel>.cfg` and `\u003Cmodel>.weights` in\n  its working directory and writes `\u003Cmodel>.onnx`.\n- Run `python3 yolo\u002Fyolo_to_onnx.py --help` to confirm the CLI in the active\n  environment, then use `-m \u003Cmodel>` only after the matching cfg\u002Fweights have\n  been validated. The supported naming convention is an architecture plus a\n  dimension, such as `yolov4-416` or `yolov4-416x256`; custom classes require\n  a matching cfg and postprocessing expectations.\n- Build `plugins\u002Flibyolo_layer.so` before the TensorRT step. The Python module\n  loads it using a path relative to the `yolo\u002F` working directory, initializes\n  TensorRT's plugin registry, looks up `YoloLayer_TRT`, replaces each raw YOLO\n  output, and concatenates them as `detections`. The plugin accepts linear\n  FLOAT tensors only; it is not an FP16 plugin implementation merely because\n  the rest of the builder sets an FP16 flag.\n- Run `python3 yolo\u002Fonnx_to_tensorrt.py -m \u003Cmodel>` for the repository's\n  baseline FP16 path. The script forces batch 1, uses a 1 GiB workspace,\n  creates a fixed optimization profile for the cfg shape, and serializes\n  `\u003Cmodel>.trt`. TensorRT 7–9 and 10+ use different branches in this checkout;\n  inspect the version-specific warnings in `compatibility.md` before running.\n- Do not call the download script as part of a routine build. It downloads\n  several large DarkNet artifacts and creates derivative cfgs\u002Fsymlinks; use it\n  only as an explicit, reviewed acquisition step.\n\n### YOLO FP16, INT8 calibration, and DLA\n\n- FP16 is the default selected builder mode in the legacy YOLO, GoogLeNet, and\n  MTCNN implementations when supported. Check `platform_has_fast_fp16` or the\n  corresponding modern capability before claiming a true FP16 build.\n- INT8 requires a platform with fast INT8 support and a representative image\n  set. The repository calibrator reads `.jpg` files from `calib_images\u002F`,\n  resizes BGR→RGB to the cfg shape, transposes to CHW, scales to `[0,1]`, uses\n  batch 1, and caches at `calib_\u003Cmodel>.bin`. The README suggests 500 images\n  and demonstrates 1,000 COCO `val2017` images; this is guidance, not a proof\n  of sufficient coverage for another deployment distribution.\n- Check calibration image readability, ordering\u002Freproducibility, class and\n  scene coverage, cache ownership, and whether the cache corresponds to the\n  exact model\u002Finput\u002Fpreprocessing. Delete or quarantine a stale cache only\n  after an explicit decision. INT8 can alter accuracy: the repository reports\n  an unresolved poor mAP result for YOLOv4-608 INT8, so always evaluate.\n- DLA is an optional Jetson Xavier\u002FNX-era path. The YOLO builder sets default\n  device DLA, selects `DLA_core`, enables GPU fallback in its TensorRT 7\u002F8\n  branch, and uses strict types; the TensorRT 3–6 branch rejects DLA. DLA\n  engine creation is not evidence that inference used the requested core.\n  TensorRT 7.1's Python API in the repository could not explicitly select the\n  inference core after deserialization. Verify device placement with the\n  target runtime's supported API and treat unsupported layers\u002Ffallback as\n  expected failure modes. The README specifically records `yolov4-tiny-416`\n  DLA build failure in the historical test.\n\n### MODNet ONNX → TensorRT\n\n- Use the checked-in `modnet\u002Fmodnet.onnx` or another approved ONNX with the\n  same input contract. The converter requires TensorRT 7+ and sets an explicit\n  batch network, batch 1, a named `Input` profile, FP16, GPU fallback, and a\n  1 GiB workspace. Defaults are width 640 and height 480; override both\n  together when the model and caller agree.\n- Invoke `python3 modnet\u002Fonnx_to_tensorrt.py --help` first, then provide\n  `input_onnx output_engine`. The repository implementation deliberately\n  raises `INT8 not implemented yet` and `DLA_core not implemented yet`; do\n  not document those flags as working MODNet features.\n- TensorRT 7.1 needs the documented private onnx-tensorrt workaround for\n  dynamic `InstanceNormalization`; TensorRT 7.2 fixed the issue according to\n  the README. Treat the uninitialized `modnet\u002Fonnx-tensorrt\u002F` submodule as\n  third-party build material, not as a bundled dependency. Prefer TensorRT\n  7.2+ for the direct converter after checking ONNX input dimensions.\n- Verify the resulting engine with `trt_modnet.py --help` or a controlled\n  headless inference harness. The README's demo expects `modnet\u002Fimage.jpg`,\n  but display\u002Fvideo tests are separate from engine creation.\n\n## Completion and handoff\n\nRecord, for each engine: source artifact hashes or provenance, TensorRT\u002FCUDA\u002F\nGPU versions, exact command and working directory, plugin and calibration\ninputs, output path, warnings, deserialization\u002Fbinding check, and accuracy or\nruntime result. Mark a path **blocked** rather than silently falling back when\nits required backend, legacy parser, custom plugin, calibration data, or DLA\nhardware is unavailable. A partial static\u002Fhelp-only check is not a successful\nengine build.\n",{"name":5,"license":14,"metadata":23,"description":7,"disable-model-invocation":25},{"disco-role":24},"operating",true,"main","ac3fe1afa80fb9a09775ecfb2b6cc3ba850a2db6","skills\u002Frepositories\u002Frepo-skills\u002Ftensorrt-demos\u002Fsub-skills\u002Fengine-building",27,"https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill","https:\u002F\u002Fgithub.com\u002FVectorSpaceLab","2026-09-03 10:25:21",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":25},[35,38,41],{"tool":36,"command":37},"npx","npx skills add VectorSpaceLab\u002FAREX-Skill --skill engine-building",{"tool":39,"command":40},"bunx","bunx skills add VectorSpaceLab\u002FAREX-Skill --skill engine-building",{"tool":42,"command":43},"pnpm","pnpm dlx skills add VectorSpaceLab\u002FAREX-Skill --skill engine-building","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Frepositories\u002Frepo-skills\u002Ftensorrt-demos\u002Fsub-skills\u002Fengine-building\u002FSKILL.md",[46,52,56,60,66],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"compatibility.md","REFERENCE","参考文档",8207,"https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Frepositories\u002Frepo-skills\u002Ftensorrt-demos\u002Fsub-skills\u002Fengine-building\u002Fcompatibility.md",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Ftroubleshooting.md",11209,"https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Frepositories\u002Frepo-skills\u002Ftensorrt-demos\u002Fsub-skills\u002Fengine-building\u002Freferences\u002Ftroubleshooting.md",{"path":57,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fworkflows.md",10162,"https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Frepositories\u002Frepo-skills\u002Ftensorrt-demos\u002Fsub-skills\u002Fengine-building\u002Freferences\u002Fworkflows.md",{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},"scripts\u002Fcheck_cuda_arch.py","SCRIPT","脚本",4026,"https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Frepositories\u002Frepo-skills\u002Ftensorrt-demos\u002Fsub-skills\u002Fengine-building\u002Fscripts\u002Fcheck_cuda_arch.py",{"path":67,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":68,"sourceHtmlUrl":69},"scripts\u002Fvalidate-engine-build-inputs.py",10835,"https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Frepositories\u002Frepo-skills\u002Ftensorrt-demos\u002Fsub-skills\u002Fengine-building\u002Fscripts\u002Fvalidate-engine-build-inputs.py",[71,79,86,93,100,107],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":75,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M799NYSH1R3RVAHSM2D88Y84","passnet-triton-opt","Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block\u002Fgrid\u002Fwarp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Ftask-oriented\u002FPassNet\u002Fskills\u002Fpassnet-triton-opt\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":75,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":18},"01M799NS5APEC0N1FZ7XZVW6BN","passnet-solve","END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.","https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Ftask-oriented\u002FPassNet\u002Fskills\u002Fpassnet-solve\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":75,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":18},"01M799NNY9BKSM21V5R7QVTBJX","passnet-skill","PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under .\u002Fpass_dir\u002F, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.","https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Ftask-oriented\u002FPassNet\u002Fskills\u002Fpassnet-skill\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":75,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":18},"01M799NHH6NP7Z1RK77KGXAN6S","passnet-pattern-fusion","Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()\u002Freplacement_args()\u002Freplacement_func() files, when a pass \"failed to match\", or when deciding how to fuse multiple kernels\u002Fops.","https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Ftask-oriented\u002FPassNet\u002Fskills\u002Fpassnet-pattern-fusion\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":75,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":18},"01M799ND2J4WNC2PGAZ0A06NDF","passnet-orchestrate","Round\u002Fbatch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep\u002Frevert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.","https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Ftask-oriented\u002FPassNet\u002Fskills\u002Fpassnet-orchestrate\u002FSKILL.md",[],[],{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":75,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":18},"01M799N8SBTMY02ZDG2AZF5ZWE","passnet-feedback","Fast, deterministic feedback for PassNet work: pre-flight pattern\u002Fmatch verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).","https:\u002F\u002Fgithub.com\u002FVectorSpaceLab\u002FAREX-Skill\u002Fblob\u002Fmain\u002Fskills\u002Ftask-oriented\u002FPassNet\u002Fskills\u002Fpassnet-feedback\u002FSKILL.md",[],[]]