` — stop the loop after N elapsed seconds (the
current iteration finishes first). `-1` (default) disables the timeout.
Useful for capping a large `full` sweep at a deadline.
- `--saveAllEngines` — in addition to the best engine at `--saveEngine=`,
write every iteration's engine to `
.iter`. Requires `--saveEngine`.
Disk-heavy; intended for debugging accuracy regressions across iterations.
- `--setBuildRoute=` — see [7.2](#72-building-one-specific-configuration).
Useful for replaying any single iteration from a sweep by hand.
For the complete list with one-line descriptions, run `./trtexec --help`
and look at the **Build Route Tuning Options** section.
#### 7.8: Caveats of tuning
A few things to keep in mind when relying on a tuning result in production:
- **Improvement is opportunistic.** The default build route may already
be the fastest one for the (model, hardware) combination you're tuning
on. Treat any speedup as a bonus, not an expected outcome.
- **An explicit knob value may be overridden during compilation.** Even
when you pin a knob with `--setBuildRoute=`, the compiler is
free to change that value internally if the network requires it. The
engine that `--saveEngine` records is the source of truth — not the
route string. Ship the saved engine when exact behavior matters.
- **Re-running a route doesn't reproduce engine bytes.** Engine builds
are not bit-deterministic; kernel timings vary, the builder breaks
ties accordingly, and the serialized engine reflects those picks.
Re-running with the same `--setBuildRoute` on the same model and the
same machine produces an engine with the same knob choices, but the
bytes may differ slightly. Again — ship the saved engine, not the
route string, when you need the exact engine that won the sweep.
- **Tuner version matters.** Across TensorRT releases, the set of
tunable knobs and their default values can change. A route or cache
produced by one version may reference knobs that no longer exist in
another, and even the default route is not stable across versions.
- **Pick a sensible `--accuracyThreshold`.** A threshold set too tight
will reject every iteration, and the sweep will report no winner. If
you don't have a prior calibration, start loose and ratchet down.
- **Results are model-specific.** The optimal route depends on the
exact ONNX. A different model — or even the same model rebuilt with
different shapes or precision flags — invalidates a previously-saved
result.
- **Results are hardware-specific.** The same model tuned on different
GPU SKUs can pick different "best" routes. Re-tune when you move to a
different target.
- **Re-tune after TensorRT / tuner upgrades.** A previously-tuned
non-default build route is **not** guaranteed to keep its advantage
after an upgrade — and may even regress relative to the new default.
Re-tune whenever the tuner version or TensorRT version changes. Only
performance regressions on the **default** build route are tracked as
TensorRT performance bugs; non-default routes are best-effort.
## Tool command line arguments
To see the full list of available options and their descriptions, issue the `./trtexec --help` command.
**Note:** Specifying the `--safe` parameter turns the safety mode switch `ON`. By default, the `--safe` parameter is not specified; the safety mode switch is `OFF`. The layers and parameters that are contained within the `--safe` subset are restricted if the switch is set to `ON`. The switch is used for prototyping the safety restricted flows until the TensorRT safety runtime is made available. This parameter is required when loading or saving safe engines with the standard TensorRT package. For more information, see the [Working With Automotive Safety section in the TensorRT Developer Guide](https://docs.nvidia.com/deeplearning/sdk/tensorrt-developer-guide/index.html#working_auto_safety).
## Additional resources
The following resources provide more details about `trtexec`:
**Documentation**
- [NVIDIA trtexec](https://docs.nvidia.com/deeplearning/sdk/tensorrt-developer-guide/index.html#trtexec)
- [TensorRT Sample Support Guide](https://docs.nvidia.com/deeplearning/sdk/tensorrt-sample-support-guide/index.html)
- [NVIDIA’s TensorRT Documentation Library](https://docs.nvidia.com/deeplearning/sdk/tensorrt-archived/index.html)
# License
For terms and conditions for use, reproduction, and distribution, see the [TensorRT Software License Agreement](https://docs.nvidia.com/deeplearning/sdk/tensorrt-sla/index.html)
documentation.
# Changelog
April 2019
This is the first release of this `README.md` file.
# Known issues
There are no known issues in this sample.