Repository navigation
[Core] Expose ring preparation, graph toggle, gather upload, and staging wait telemetry - #174
Conversation
|
Independent audit — non-GPU stage Reviewed head [P2] Return unavailable when the native engine has no snapshot API Location: _native_counters, especially line 34. The module promises This was reproduced by executing the real reader module with an object matching the older API shape. No torch import, native extension, CUDA API or GPU work is involved. Copyable CPU reproduction from this PR checkoutRun from the repository root at the audited commit: CUDA_VISIBLE_DEVICES='' python - <<'PY'
import importlib.util
from pathlib import Path
path = Path("src/dmi/sync_stats.py")
spec = importlib.util.spec_from_file_location("audited_sync_stats", path)
stats = importlib.util.module_from_spec(spec)
spec.loader.exec_module(stats)
class LegacyRingEngine:
# API shape of a pre-#174 native RingEngine: no get_stats method.
pass
for name in ("synchronization_stats", "pipeline_stats"):
try:
print(name, getattr(stats, name)(LegacyRingEngine()))
except Exception as exc:
print(name, type(exc).__name__, str(exc))
PYObserved: Expected: both calls return Suggested change: check for a callable Performance/architecture observations, not measured regressions: snapshot reads are host-side in the inspected implementation. Instrumentation itself is still active on ordinary paths: clocks and atomic counters run even when no telemetry reader is used. That is shared-path overhead and needs the deferred default-off pipeline comparison; “host-only” does not establish zero overhead. Validation context: both baseline and cumulative head built their CPU-only native targets. Python compile/package checks passed, and the cumulative head passed F821. The full CPU run plus the targeted C++ runtime-environment rerun yielded 2,781 passing unique test nodes, one GPU-dependent skip, and one unchanged hard-coded temporary-directory permission failure. The baseline had 2,700 passing unique nodes and the same two remaining outcomes. Replaying that directory-bound test's assertions with a private writable spool passed on both versions. These are merged run results, not a claim that a single full invocation was entirely green. None of those standard tests covered the missing-method case above. |
526e05f to
abaf9b1
Compare
7f98428 to
c1d242b
Compare
|
@Samfisheryu thanks for the audit. Fixed in abaf9b1, rebased onto the revised #173. [P2] A native engine without Tests in On the overhead note: agreed. Snapshot reads are host-only, but the clocks and atomic counters run on ordinary paths whether or not a reader is used. "Host-only" is not a zero-overhead claim, and the default-off pipeline comparison stays on the deferred list. Verification for this revision (full stack), CPU only: the native extension builds, and the |
|
Independent re-review of C174-1 is resolved. I independently ran the actual readers against both a legacy API-shaped object and a working API that raises a sentinel exception: The absence/non-callability check is correctly placed before invocation; existing getter failures are not swallowed. The six CPU telemetry cases pass; the three GPU cases were deselected, not counted as passes. Full-stack local checks: CPU-only native targets built from this exact checkout; Python compile, package-layout and F821 checks passed. The full CPU suite reported 2,846 passed, 1 failed, 1 skipped, 513 deselected. The failure remains the unchanged This stack is not ready for merge yet. The remaining #171–#173 findings are reported on the introducing PRs. In particular the reviewed commit's CI also has concrete upstream failures:
Telemetry's ordinary-path clock/atomic cost remains a measurement item; the missing-API fix itself adds no work to producer hot paths. No GPU validation or benchmark was performed. |
abaf9b1 to
c60d511
Compare
c1d242b to
21f58b1
Compare
|
@Samfisheryu thanks for confirming C174-1. This branch is now c60d511, rebased cleanly onto the revised #173 (21f58b1). The telemetry commit is unchanged by the rebase. Both CI failures you traced to #171 and #173 are fixed there (details on those PRs). Checks on this head, CPU only:
No GPU tests, CUDA initialization or benchmarks were run. GPU validation and the telemetry overhead measurement stay deferred until the owner gives the go-ahead. |
|
Independent third review of This revision carries the updated dependency stack; its telemetry implementation is unchanged from the previously reviewed fix. The missing/non-callable getter returns unavailable, while errors from an existing getter still propagate. The 6 CPU telemetry cases pass; 3 device cases were not executed. All 7 remaining round-two items in #171–#173 have now been independently checked with corrected expectations and previous-version controls. No confirmed non-GPU item remains open at these fixed revisions. The latest full-stack workflow passes CPU/package checks, live catalog checks, native compilation and standalone host test linking. Local full-stack CPU result: 2,899 passed, 1 failed, 1 skipped (513 deselected). The failure is the unchanged fixed-temporary-directory permission case. Repeating its layout assertions with a private writable spool passes on this revision, as on the baseline; the existing shared temporary directory was left untouched. The skip requires a device. The independent allocation, queue-reference, counter and shape/capacity evidence is summarized on the introducing PRs. This closes the previous non-GPU findings; it is not a final GPU or performance approval. Actual kernels, graph replay, device memory behavior, staging-saturated deadline timing and default-off overhead still await the owner's explicit instruction. No GPU tests or benchmarks were started. |
Samfisheryu
left a comment
There was a problem hiding this comment.
Approved at c60d5118daafa388a35907f9667c5195277abe64 following the completed independent code and CPU/host review. The issues raised for this PR have been addressed and independently rechecked. The reviewed commit's CI is successful.
Review record: #174 (comment)
GPU execution and end-to-end performance benchmarks remain a separate follow-up, pending the owner's explicit instruction as agreed. This approval records the completed code/CPU review and does not claim those measurements.
21f58b1 to
d91a545
Compare
…ing wait telemetry Make the legacy ring's existing waits and copies observable without adding any: host-only cumulative counters, read with no CUDA work. Native: - RingEngine.get_stats() returns RingFlushStats: reservation heads and drain tails; prepare_step outcomes (ok / flushed / oversized) and the time of its stream synchronizations and forced flushes; node-toggle pre-apply waits; drain waits for staging space; per-task ready-to-commit latency (first seen published to committed after D2H); D2H copy and synchronization failures; staging-to-pageable copies (calls, time, bytes). - HostWaitCounter (host_wait_counter.h) times a call that runs anyway and counts nonzero CUDA statuses and exceptions as errors; DrainTelemetry and PageableCopyTelemetry (pipeline_telemetry.h) hold the stage counters. An uncontended staging check reads no clock. Python: - dmi.sync_stats: synchronization_stats, pipeline_stats and gather_sync_stats (an integration's per-HookPoint row-table uploads, reuses and pre-write waits) return versioned dicts, report unavailable counters instead of zeros, and reject negative ones. A native RingEngine built before get_stats existed reports unavailable (rebuild required) rather than raising AttributeError; errors from an existing get_stats still propagate. - MonitoringEngine logs the ring's device payload, pinned staging and task entries when it builds a legacy ring: memory allocated before a serving framework profiles free device memory reduces its KV cache by the same amount.
c60d511 to
453d2b2
Compare
Depends on #173.
Summary
Host-only counters for the waits and copies the ring already performs, read
without CUDA work, and a log line with the ring's footprint.
Implementation details
host_wait_counter.h,pipeline_telemetry.h;RingEngine.get_stats()(prepare outcomes, sync and forced-drain waits, toggle pre-apply waits,
staging waits, ready-to-commit latency, D2H errors, pageable copies);
dmi.sync_statsreaders (synchronization_stats,pipeline_stats,gather_sync_statsover an integration'srow_table_stats()); INFO log ofthe payload ring, pinned staging and task entries at ring build.
docs/ring-telemetry.md.Compatibility and scope
Read-only additions.
Validation
test_ring_telemetry.py(5); all native ring suites pass.