Repository navigation
QFw: attach the provider's own phase times to the job's execute span - #173
Conversation
qfw.backend.execute is one opaque block of seconds on a real device, and the only account of how that time divides into queueing, compiling and running is the provider's own: IQM keeps a timeline per job, one timestamped event per phase. The native IQM QPM already parses it and kept it to itself; the shim got nothing, because QRMI returns the measurements alone from task_result and prints the timeline only as the text of task_logs. A new optional extension, QFW_TELEMETRY_VENDOR=1, flag-guarded like the transport spans: the seconds per phase (queue, validation, compilation, execution, post_processing, total) go on the execute span as qfw.vendor.<phase>_s and into a qfw.vendor.duration histogram labelled by phase beside the backend labels. Durations only, never spans at the provider's timestamps, which are another clock. The native QPM records them from its summary; the shim, for IQM only, asks task_logs after a completed job and reads the timeline from the text (util/iqm_timeline), one more request to the provider per job, which is why the flag. QDMI exposes no timing, so that path carries none. Tests: the parser against QRMI's text format, the recorder on and off under backend_execution, and the driver's gate, provider check and wiring with a fake resource. The design doc gains the extension. Signed-off-by: Doug Oucharek <dougso@me.com>
|
Live on the ORNL q20 (2026-10-23, tunnel back): the site shim QPM run from an install of this branch with QRMI path, execute span
on the span as QDMI path, execute span The parse of |
What
qfw.backend.executeis one opaque block on a real device (9.5 s via QRMI, 3.5 s via QDMI on the q20 in the 2026-10-12 runs), and the only account of how that time divides into queueing, compiling and running is the provider's own. IQM keeps a timeline per job, one timestamped event per phase fromcreatedtocompleted.A new optional extension,
QFW_TELEMETRY_VENDOR=1, flag-guarded like the transport spans:queue,validation,compilation,execution,post_processing,total) go on the execute span asqfw.vendor.<phase>_sand into aqfw.vendor.durationhistogram labelled byqfw.vendor.phasebeside the backend labels, so a dashboard gets an "inside the device" row per API path and device;Where the data comes from
task_resultreturns the measurements alone, and the timeline is available only as the text oftask_logs. After a completed job the driver asks for it andservices/util/iqm_timeline.pyreads the phase durations from the text. That is one more request to the provider per job, which is why the flag. A QRMI change that returns the timeline with the result is proposed upstream as iqm: return the job's record with the task result qiskit-community/qrmi#330; when it lands the text route can go.Tests
tests/test_iqm_timeline.py(the parser against QRMI's exact text format, partial and empty timelines), two tests intests/mock/test_instrumentation.py(off by default; on: attributes on the execute span, histogram points labelled by phase, api path and device), andtests/mock/test_qrmi_vendor_timing.py(flag off asks nothing of the provider; a completed IQM job is asked once; other providers are left alone; unreadable text records nothing). Unit 24 passed, the mock suite 841 passed, ci-syntax clean.Not run against the q20: the tunnel is down today. The parser is written to QRMI's
task_logsformat string, and the live check follows when the tunnel is back.