Configuration
Understand the configuration model well enough to predict what a run will do: the merge order, what is validated, and the behaviours that follow from a key but are not visible in its type. The key-by-key schema is generated from the source on the configuration reference; the Python types are on the API reference.
Prerequisites
Section titled “Prerequisites”A completed Configure a run, which introduces the file and the blocks a first profile touches.
1. How the layers merge
Section titled “1. How the layers merge”- The YAML file named by
--configis loaded, if given. - Command-line flags override matching keys; settings without a CLI flag
remain in YAML. The model path can also be the positional argument of
hpx profile. - Defaults fill any key still unset.
- The result is frozen into an immutable
ProfileConfig. Every stage reads the same object; nothing mutates it afterwards.
Unknown fields in typed configuration blocks are rejected with a
did-you-mean suggestion. Engine-specific options under engine.config are
passed to the selected adapter; consult Engines for its
supported keys.
2. A worked file
Section titled “2. A worked file”model: path: my_model.tflite arena_size: 131072
engine: type: helia-rt config: variant: release-with-logs
target: board: apollo510_evb toolchain: arm-none-eabi-gcc jlink_serial: "" # pin one probe by serial when several are attached
profiling: pmu_counters: cpu: all memory: all # requires a target with the memory profiling domain mve: all per_layer: true iterations: 5 warmup: 2
power: enabled: false driver: joulescope mode: external duration_s: 30 io_voltage: 1.8
output: format: csv dir: ./results model_explorer: true detailed: falsehpx profile --config hpx.yml --board apollo510b_evb --iterations 50 --output-dir ./my_results| Block | Page |
|---|---|
model |
Models, Memory placement |
engine |
Engines |
target |
Boards and targets, Toolchains, Capture transports |
profiling |
PMU counters |
power |
Power measurement |
output |
Output files, Model Explorer |
timeouts, build |
This page, below |
3. Behaviour a schema table cannot express
Section titled “3. Behaviour a schema table cannot express”heliaRT
Section titled “heliaRT”engine.config.resolver_opsdefaults toauto; leave it unless you want the broaderallresolver surface.- With no engine path override hpx resolves the pinned
nsx-helia-rtmodule through the neuralSPOT-X registry;source_path,dist_pathorsourceare for an explicit local or custom runtime. target.clock.cpuselects the CPU frequency by the board’s named tier; unset means the board’s lowest-power tier.- Models with
CALL_ONCE,VAR_HANDLE,ASSIGN_VARIABLEorREAD_VARIABLEget the resource-variable runtime enabled from model analysis; no firmware patch is configured. - After a successful run, tighten
model.arena_sizefrom the reportedallocated_arenarather than growing it blindly.
heliaAOT
Section titled “heliaAOT”-
A module that ships its own transfer provider (
<prefix>_nsx_transfer.h, heliaAOT’snsxmodule with dma units) needs an nsx-ambiq-sdk withnsx_psram_dma_in_progress: main at commit 6795b3d977a5b59482fc1ab2d1c65ccca8d05de3 or later. Select it withbuild.nsx_modules.<module>.ref. The pinned baseline’s nsx-psram has no asynchronous read, and the provider’s own API check does not cover that accessor. hpx binds the provider beforemodel_init. The profile build calls the accessor in every capture of such a module, so it needs nsx-psram at that commit or later; an earlier one fails to compile. A fixed fixture binds neither a transfer provider nor a stream pool, so a fixture capture of a module with either (dma or cpu transfer units) is refused; profile it withhpx profile, or convert it without streaming for a fixture. -
A module with a stream pool needs
engine.config.aot_args.memory.allocate_arenas: false. hpx binds arenas only in that mode, and heliaAOT’smodel_initfails with 10 while the pool is unbound, so hpx refuses the conversion otherwise. -
Every heliaAOT capture now carries new lines:
HPX_INPUT_FILL.- An FNV-1a 64 digest of each output after every instrumented run
(
HPX_OUTPUT_<i>_FNV1A64). - At the end, the input digests and the bytes of each output up to 1024
bytes (
-for an empty one), so two captures of one model compare byte for byte.
The host keeps these values as printed strings.
-
profiling.input_fill: lcgfills every input from a fixed-seed 32-bit LCG before each run instead of zeros, so an output depends on every weight, not on biases alone.- The default,
zero, leaves the measurements unchanged. - Inputs are refilled inside the clean (and power-gated) window, as zeros
always were, so under
lcgthe clean latency and energy include the LCG fill (a few cycles per input byte). The capture records no clean workload for them. lcgwrites raw bytes, so it is refused unless every model input is int8, uint8 or int16. A float input would read NaN, infinities and huge values, and 32- and 64-bit integer inputs hold indices or lengths, which not every kernel bounds. Usezerofor such a model.lcgis also refused for other engines.
- The default,
-
profiling.transfer_timeout_probe: trueneeds the module’s provider.- Before the first pass, hpx runs one extra run, outside the counted iterations and every timing window, with the profiler off.
- Its waits give up after two checks, so a transfer still in flight times out.
- hpx samples nsx-psram’s pending reads as the run returns, binds the default
budget again, and runs
model_initand one more run, with the stream pool poisoned before each run. - The capture prints
HPX_TRANSFER_PROBE=<status>,<provider>andHPX_TRANSFER_RECOVERY=<bind>,<init>,<run>,<pending>. - Any other failure fails the capture.
-
profiling.sweep_evidence: truerecords each timed heliaAOT invocation’s cycles, DMA provider status and output digests infirmware_output.txt. The sweep command enables it automatically. Static schedules run a separate whole-model timing loop and report an empty per-operator table. -
profiling.stream_evidence: truechanges the cache regime of the per-layer figures andHPX_PROFILED_INFER_*. The warm-ups and clean window followprofiling.dcache. The capture saysHPX_STREAM_EVIDENCE=1.- Before every instrumented run, hpx fills the stream pool with
0x5Aand cleans and invalidates the D-cache over each PSRAM constant arena. A late or missing copy then shows in the outputs, and every constant read reaches the MSPI controller. - It applies to any module whose stream pool or PSRAM constant arenas hpx binds, with dma units, cpu units or none. A module without a pool gets the invalidate alone. The unstreamed reference capture takes the setting too, so compared captures share one regime.
- It is refused on parts without an explicit D-cache (Apollo3, Apollo4), for modules with neither a bound pool nor PSRAM constants, and for other engines.
- Without the setting, no capture is poisoned or invalidated.
- Before every instrumented run, hpx fills the stream pool with
Transfer diagnostics
Section titled “Transfer diagnostics”Normal per-layer PMU capture does not poll DMA or pending-read status. To observe transfers, select one separate diagnostic mode for a table-schedule heliaAOT module with an emitted DMA provider on an Apollo5 CPU target:
profiling: transfer_diagnostics: timing transfer_diagnostic_iterations: 2The default mode is off; the iteration count defaults to 1 and accepts integers
from 1 through 1000. Programmatically, use
Session().with_profiling(transfer_diagnostics="timing", transfer_diagnostic_iterations=2).
Static schedules, disabled per-layer profiling, modules without the provider and
NPU backends are refused. The dedicated power binary runs no diagnostics.
timingrecords each unit’s issue and wait call duration with a continuous CPU cycle counter. Its callback does no PMU reads, status polling, printing or interrupt masking. These durations include call bookkeeping, interrupt service and the observer itself; they are not physical DMA service time. An absent wait isnull, while an observed wait can take zero cycles.overlapmakes DMA and pending-read queries at both ends of unit issues and operator runs. These queries perturb execution. Flags describe the sampled endpoints and do not establish continuous overlap. An unreadable DMA flag isnull. This mode runs separately from direct timing.
trace records a chronological diagnostic invocation using an optional completion
observer from the emitted provider. It requires a released runtime record declaring
transfer_observer: true; an unrecorded or older provider is refused. The
compatibility baseline lists the adopted
observer release. This release gate is separate from existing timing and
overlap support and does not establish board qualification.
profiling: transfer_diagnostics: trace transfer_diagnostic_iterations: 1 transfer_trace_max_pieces: 256The completion capacity accepts integers from 1 through 4096. Completion storage
is fixed before the invocation; overflow retains the first records and reports
loss, rather than overwriting them. Unit and operator boundaries use separate
bounded storage. Native diagnostics include a versioned hpx.transfer-trace
record with run-relative cycle offsets, binding epoch, piece sequence/ticket,
byte counts, statuses, storage size, loss counts and clock/quiescence flags.
Completion arrival order stays distinct from accepted-read sequence order.
A completion event marks entry to the observer in the MSPI interrupt. It includes queue and interrupt-delivery effects; it does not establish physical bus finish, DMA-active intervals, exact per-piece submission latency or achieved bandwidth. Issue/wait and operator boundaries come from the same continuously running clock, in a separate PMU-free run. Observer storage stays live through recovery; a failed drain cannot qualify or reuse its records. Incomplete diagnostic data remains evidence for diagnosis, not a qualified chronological measurement.
Before each invocation, firmware announces a bounded silence budget based on the configured CPU rate’s full 32-bit cycle-counter span. The host holds its inactivity deadline across that run, with a delivery margin, while respecting the overall capture deadline. Reporting the diagnostic end releases the hold. No heartbeat is printed within the timed invocation.
Diagnostic iterations follow the PMU passes and never enter their counts, layer
averages or HPX_PROFILED_INFER_* values. Native JSON retains them under
transfer_diagnostics; CSV bundles also include this JSON companion. Each record
identifies purpose, iteration, configured CPU rate, preparation, elapsed cycles,
run status and completeness. Provider issue/wait/abort counts are per run; its
peak and wait-check maxima remain since binding. Older saved PMU transfer evidence
remains readable.
complete: true requires successful paired callbacks and a plausible CPU-cycle
span against the independent STIMER clock (one tick of quantization and a 5% rate
band). A stopped clock or an interval approaching a full 32-bit cycle-counter
span cannot qualify. Incomplete records retain observations for diagnosis, not
qualified durations. The CPU rate is configured/reported, not a measured rate.
With stream_evidence: true, diagnostics use the same poisoned-pool/cold-constant
preparation and record cold; otherwise they record configured. Compare runs
only with matching input, plan, placement, clocks and preparation. A difference
between clean and instrumented latency does not isolate sampling overhead.
Timing storage is one fixed record per transfer unit, reused across iterations;
this changes firmware memory use and can affect placement. Board qualification of
the timing and observer effect remains necessary before using it for claims.
Static heliaAOT schedules
Section titled “Static heliaAOT schedules”Select a static schedule through the heliaAOT configuration:
engine: type: helia-aot config: aot_args: module: schedule: staticUse the same mapping with Session.from_dict(...), or pass the config
mapping to Session.with_engine("helia-aot", config=...). Run the YAML with
hpx profile model.tflite --config hpx.yml.
A static module omits per-operator callbacks. HPX records this capability,
plans no per-layer PMU passes, and keeps the clean whole-model timing and
compiler metadata. The result is a model-only bundle.
profiling.stream_evidence requires callbacks and is refused for this schedule;
use module.schedule: table for per-layer counters and instrumented transfer
evidence. Table schedules and interpreter engines retain their layer requirements.
Data-cache policy
Section titled “Data-cache policy”For an Apollo5 profiler run, use profiling.dcache: "off" to disable the
data cache after engine initialization and before warmup and measurement:
profiling: dcache: "off"In Python, use Session().with_profiling(dcache="off"). The default "on"
retains normal system initialization. YAML boolean aliases are normalized to
"on"/"off"; other values fail validation. Targets without an explicit
data cache refuse "off" before a build. The setting leaves instruction-cache
policy unchanged.
The off path publishes dirty writes before disabling the data cache. A failed
cache operation stops the capture. Apollo5 profile firmware reports
HPX_DCACHE=on|off; a missing or mismatching report cannot satisfy an off
request. The bundle records the report in firmware.dcache and the existing
conditions.weights_cache comparison dimension. Older streams without the
field retain the existing on/default interpretation.
Regular profiler firmware and its matching dedicated power image follow this
policy. Fixed fixture methods reject "off"; use ordinary profiling for a
cache-controlled capture. The on/default setting is omitted from saved
configuration snapshots to preserve older intent identities; off remains
explicit and changes the run intent. Keep the model, module options, clocks
and placements fixed when comparing on/off captures.
Target overrides
Section titled “Target overrides”target.platform_overlayloads one explicit catalog YAML file, resolved from the working directory. Catalog overlays describes lineage, custom-policy precedence and saved-source checks.target.custom_boardsadds config-scoped board definitions andtarget.custom_socsconfig-scoped SoC definitions; Boards and targets walks the fields, the pin rules and the application flash load address.- The four
*_gpio_pinkeys take a plain integer pad number; booleans are rejected.ble_reset_gpio_pinis inherited frombased_on, and0is rejected there as ambiguous. - A custom SoC with neither
based_onnorapp_flash_load_addrhas no flash address and the fallback flash refuses to run rather than guess. - Unrecognised keys in either block are rejected with the supported list
and a close-match suggestion; both blocks accept a free-form
description.
Build resolution
Section titled “Build resolution”- Generated profiler applications keep the board’s normal neuralSPOT-X
channel, and hpx pins the verified commits for
neuralspotxandnsx-ambiq-sdkrecorded in the compatibility baseline (src/helia_profiler/data/compatibility-baseline-v1.json). build.nsx_modules.<module>.refoverrides that default for the owning project;.pathinstalls a local checkout for that module and bypasses registry resolution for it alone.- Engine-owned
nsx-helia-rtandnsx-cmsis-nnsources are selected byengine.config, notbuild.nsx_modulesor--nsx-module. An override targeting one of these engine-provided modules is ignored with a warning. Usesource_path,dist_pathorsourcefor heliaRT, andcmsis_nn_pathorcmsis_nn_reffor its source-built CMSIS-NN provider. Engine configuration describes which selectors each runtime mode supports. - Ordinary profiles reuse a compatible
nsx.lockbyte for byte and runnsx sync --frozen; a lock is resolved only when missing or structurally incompatible.build.update_dependencies: true(--update-dependencies) is the explicit operation that refreshes refs and rewrites the lock; it cannot be combined with offline mode. build.offline: true(--offline) requires a compatible lock and already-materialised module trees.--frozenremains as an alias for this strict mode.- Cached applications are isolated by a deterministic workspace fingerprint over the compatibility baseline and registry hashes, target and toolchain, engine backend, variant and version, overrides (including local content hashes) and the module-relevant build settings.
Module build options
Section titled “Module build options”Use build.nsx_modules.<module>.options alongside an explicit ref or path
to set a module’s CMake cache values before NSX loads it:
build: nsx_modules: nsx-psram: ref: <actual-project-tag-or-commit-SHA> options: NSX_PSRAM_ASYNC_DEPTH: 16The Python equivalent is:
from helia_profiler import Session
session = Session().with_build(nsx_modules={ "nsx-psram": { "ref": "<actual-project-tag-or-commit-SHA>", "options": {"NSX_PSRAM_ASYNC_DEPTH": 16}, },})Values are literal single-line strings, finite numbers or booleans; booleans
become CMake ON/OFF. Names must be identifiers such as
NSX_PSRAM_ASYNC_DEPTH. Strings are not expanded as CMake expressions.
The selected module owns the supported options and their ranges. hpx does
not infer queue depth from a model or increase it automatically.
CMake cache names are global to the build. hpx refuses conflicting values
across modules, keys controlled by the profiler or selected engine, and options targeting
unused or engine-owned modules. Configure engine-provided modules through
engine.config instead. An option does not enable an otherwise unused module.
Nonempty options are recorded beside the source selector in frozen plans and the bundle’s configuration, and in dependency workspace inputs. Changing an option selects a different workspace. Absent or empty options preserve existing plan and workspace identities. These records describe the requested build settings; provider compilation and binding still determine whether the selected source supports them.
Migrating module version overrides
Section titled “Migrating module version overrides”Non-null build.nsx_modules.<module>.version,
--nsx-module NAME:version=..., and Python
NsxModuleOverride(version=...) are no longer supported. The dependency
resolver did not honor this selector, so a recorded version request did not
prove which source was selected. Use ref with the owning project’s actual
Git tag or commit SHA, or path with a local NSX module root. A module’s
semantic version need not be a tag in its owning SDK repository; do not
convert it by simply adding a v prefix. For example:
build: nsx_modules: nsx-core: ref: <actual-project-tag-or-commit-SHA>The equivalent CLI option is --nsx-module nsx-core:ref=<actual-project-tag-or-commit-SHA>;
in Python use NsxModuleOverride(ref="<actual-project-tag-or-commit-SHA>").
Modules in the same project must select the same ref. NSX resolves that ref;
an unavailable ref fails instead of falling back to the baseline.
The deprecated Python/config field version accepts only None/null to
preserve existing serialized plans. A path or ref is still required when
an override is present. Historical default, path and ref plans retain their
stored hashes and replay behavior. Historical non-null version plans and
provenance remain readable with their original fields, hashes and bindings,
but converting those plans to current configuration or rebuilding them fails
with migration guidance. Select the actual project ref and freeze a new plan
to rebuild. Already compiled artifacts still support verification and running
under the existing artifact and capture guards; that does not establish that
the old version request was honored. Reading these records does not rewrite
the source artifact or reinterpret the old selector.
Compiler launcher
Section titled “Compiler launcher”auto(the default) wraps every compile with sccache or ccache if either is onPATH, and does nothing otherwise; installing the binary opts you in. The launcher hashes the full compile inputs, so caching is correctness-safe, and it accelerates only the compile step, not neuralSPOT-X lock, sync, configure or flash.none(alsoofforfalse) disables it; an explicit tool name or path is required and fails the build if not found.--compiler-launcherand--no-compiler-launcheroverride the field.HPX_COMPILER_LAUNCHERtakes precedence over both the field and these flags.
On Unix, sccache starts its server through a temporary Unix socket. If it
reports path must be shorter than SUN_LEN, choose a short, writable temporary
directory that you own and set TMPDIR before starting HPX or the benchmark
command:
mkdir -p /absolute/short/owned/tmpexport TMPDIR=/absolute/short/owned/tmpChild tools inherit this setting; build workspaces, caches and result directories
remain configured independently. Changing only SCCACHE_DIR or the server’s
TCP port does not shorten the startup socket path.
If compiler caching is unnecessary, HPX_COMPILER_LAUNCHER=none disables the
launcher through the existing configuration route.
Timeouts
Section titled “Timeouts”The timeouts block sets limits in seconds for the host-side steps:
configure_s (120), build_s (300), flash_s (120), toolchain_probe_s
(5), binary_probe_s (10), download_api_s (30) and download_asset_s
(300), as TimeoutsConfig defines them. Raise a limit rather than remove
it when a slow bench trips one.
Expected output
Section titled “Expected output”run_metadata.json in every bundle holds the fully resolved configuration
after the merge, so the file, the flags and the defaults that produced a
result are always recoverable from the result.
What next
Section titled “What next”The configuration reference for every key, type and default; Boards and targets for the custom board fields this page only summarises.