Skip to content
heliaPROFILER
User guide
HELIA

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.

A completed Configure a run, which introduces the file and the blocks a first profile touches.

  1. The YAML file named by --config is loaded, if given.
  2. 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.
  3. Defaults fill any key still unset.
  4. 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.

hpx.yml
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: false
Terminal window
hpx 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”
  • engine.config.resolver_ops defaults to auto; leave it unless you want the broader all resolver surface.
  • With no engine path override hpx resolves the pinned nsx-helia-rt module through the neuralSPOT-X registry; source_path, dist_path or source are for an explicit local or custom runtime.
  • target.clock.cpu selects the CPU frequency by the board’s named tier; unset means the board’s lowest-power tier.
  • Models with CALL_ONCE, VAR_HANDLE, ASSIGN_VARIABLE or READ_VARIABLE get the resource-variable runtime enabled from model analysis; no firmware patch is configured.
  • After a successful run, tighten model.arena_size from the reported allocated_arena rather than growing it blindly.
  • A module that ships its own transfer provider (<prefix>_nsx_transfer.h, heliaAOT’s nsx module with dma units) needs an nsx-ambiq-sdk with nsx_psram_dma_in_progress: main at commit 6795b3d977a5b59482fc1ab2d1c65ccca8d05de3 or later. Select it with build.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 before model_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 with hpx 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’s model_init fails 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: lcg fills 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 lcg the clean latency and energy include the LCG fill (a few cycles per input byte). The capture records no clean workload for them.
    • lcg writes 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. Use zero for such a model. lcg is also refused for other engines.
  • profiling.transfer_timeout_probe: true needs 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_init and one more run, with the stream pool poisoned before each run.
    • The capture prints HPX_TRANSFER_PROBE=<status>,<provider> and HPX_TRANSFER_RECOVERY=<bind>,<init>,<run>,<pending>.
    • Any other failure fails the capture.
  • profiling.sweep_evidence: true records each timed heliaAOT invocation’s cycles, DMA provider status and output digests in firmware_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: true changes the cache regime of the per-layer figures and HPX_PROFILED_INFER_*. The warm-ups and clean window follow profiling.dcache. The capture says HPX_STREAM_EVIDENCE=1.

    • Before every instrumented run, hpx fills the stream pool with 0x5A and 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.

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: 2

The 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.

  • timing records 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 is null, while an observed wait can take zero cycles.
  • overlap makes 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 is null. 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: 256

The 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.

Select a static schedule through the heliaAOT configuration:

engine:
type: helia-aot
config:
aot_args:
module:
schedule: static

Use 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.

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.platform_overlay loads one explicit catalog YAML file, resolved from the working directory. Catalog overlays describes lineage, custom-policy precedence and saved-source checks.
  • target.custom_boards adds config-scoped board definitions and target.custom_socs config-scoped SoC definitions; Boards and targets walks the fields, the pin rules and the application flash load address.
  • The four *_gpio_pin keys take a plain integer pad number; booleans are rejected. ble_reset_gpio_pin is inherited from based_on, and 0 is rejected there as ambiguous.
  • A custom SoC with neither based_on nor app_flash_load_addr has 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.
  • Generated profiler applications keep the board’s normal neuralSPOT-X channel, and hpx pins the verified commits for neuralspotx and nsx-ambiq-sdk recorded in the compatibility baseline (src/helia_profiler/data/compatibility-baseline-v1.json).
  • build.nsx_modules.<module>.ref overrides that default for the owning project; .path installs a local checkout for that module and bypasses registry resolution for it alone.
  • Engine-owned nsx-helia-rt and nsx-cmsis-nn sources are selected by engine.config, not build.nsx_modules or --nsx-module. An override targeting one of these engine-provided modules is ignored with a warning. Use source_path, dist_path or source for heliaRT, and cmsis_nn_path or cmsis_nn_ref for its source-built CMSIS-NN provider. Engine configuration describes which selectors each runtime mode supports.
  • Ordinary profiles reuse a compatible nsx.lock byte for byte and run nsx 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. --frozen remains 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.

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: 16

The 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.

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.

  • auto (the default) wraps every compile with sccache or ccache if either is on PATH, 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 (also off or false) disables it; an explicit tool name or path is required and fails the build if not found.
  • --compiler-launcher and --no-compiler-launcher override the field. HPX_COMPILER_LAUNCHER takes 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:

Terminal window
mkdir -p /absolute/short/owned/tmp
export TMPDIR=/absolute/short/owned/tmp

Child 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.

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.

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.

The configuration reference for every key, type and default; Boards and targets for the custom board fields this page only summarises.