Skip to content

Strip all LOG_* call sites — logging re-tiering baseline - #1447

Merged
ChaoZheng109 merged 1 commit into
hw-native-sys:mainfrom
ChaoZheng109:issue-1428-strip-all-logs
Jul 27, 2026
Merged

Strip all LOG_* call sites — logging re-tiering baseline#1447
ChaoZheng109 merged 1 commit into
hw-native-sys:mainfrom
ChaoZheng109:issue-1428-strip-all-logs

Conversation

@ChaoZheng109

@ChaoZheng109 ChaoZheng109 commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Reduce logging footprint (#1428)

Curate LOG_* call sites across the runtime and platform layers: drop
low-signal logs, demote per-item detail to LOG_DEBUG, and keep the
diagnostics that trace program flow or failures.

Net effect vs base (individual call sites; a2a3 / a5 counted separately)

Action Count
Removed 73 (55 LOG_INFO_V0 + 8 LOG_DEBUG + 5 LOG_INFO_V9 + 2 LOG_ERROR + 3 LOG_WARN)
Demoted to LOG_DEBUG 162 (LOG_INFO_V0LOG_DEBUG)
Newly added 0

Curation rules

  • Flow / lifecycle / summary logs kept at INFO; per-item (per-tensor,
    per-arg) detail demoted to LOG_DEBUG; failure paths stay
    LOG_ERROR / LOG_WARN. Loader / device-runner load-path diagnostics
    kept at their original levels.
  • AICPU hot paths (per-task / per-scope dispatch loops) carry no logs
    (codestyle rule 7); DFX collectors keep their buffer-level init/flush
    diagnostics and telemetry counters.
  • STRACE, LOG_RUNTIME_FAILURE and ACL logging left untouched.
  • Log-only support removed with its logs (bookkeeping counters, dump
    scaffolding); out-of-scope strip collateral restored (unused-parameter
    removals, blank-line deletions).

Rebased onto upstream/main; dense dependency diagnostics follow upstream's
debug-only / removed decisions (#1448), completion follows the polling
mechanism (#1435).

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 62db7883-e9a1-45bf-a66d-83c2e6aa2871

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR reduces routine informational logging across a2a3 and a5 execution, scheduling, profiling, and diagnostic paths. It also adds collector scope cleanup, preserves unusable-device state after failed reset recovery, adjusts PMU teardown, and resolves task binary addresses using the CoreCallable binary-data offset.

Changes

Runtime logging and cleanup

Layer / File(s) Summary
Runner lifecycle and collector cleanup
src/*/platform/onboard/host/device_runner.cpp, src/*/platform/shared/*/pmu_collector*, src/*/platform/sim/host/device_runner.cpp
Collector finalization is guarded on scope exit, failed reset recovery preserves device_unusable_, and PMU cleanup/reconciliation behavior is updated.
Execution and platform logging
src/*/platform/*, src/*/runtime/*/aicpu/*, src/*/runtime/*/host/runtime_maker.cpp
Routine AICPU, PMU, register, tensor staging, copy-back, and simulator messages are removed or downgraded to debug logging.
Scheduler and shared-state diagnostics
src/*/runtime/*/runtime/scheduler/*, src/*/runtime/*/runtime/shared/*, src/*/runtime/*/pto_orchestrator.cpp
Scheduler, dispatch, shared-memory, TensorMap, and completion diagnostics use lower verbosity while error handling and state transitions remain.
Task binary address resolution
src/common/platform/onboard/host/device_runner_base.cpp
Task binary addresses are derived from resolved callable addresses plus CoreCallable::binary_data_offset().

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

Possibly related PRs

Poem

A rabbit hops through logs so bright,
And dims the chatter into night.
Collectors clean, resets restore,
Tasks find their binary shore.
Debug crumbs remain in view—
A quieter run, both swift and true.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 58.70% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: reducing and re-tiering logging across the codebase, though "all LOG_*" is a bit overstated.
Description check ✅ Passed The description is directly aligned with the diff, summarizing the logging reductions, demotions, and retained diagnostics.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ChaoZheng109
ChaoZheng109 force-pushed the issue-1428-strip-all-logs branch 3 times, most recently from c0a7c39 to e407c3e Compare July 23, 2026 12:09
@ChaoZheng109
ChaoZheng109 force-pushed the issue-1428-strip-all-logs branch from e407c3e to 2c1b192 Compare July 27, 2026 01:08
@ChaoZheng109
ChaoZheng109 marked this pull request as ready for review July 27, 2026 01:40

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/a2a3/platform/onboard/host/comm_hccl.cpp`:
- Line 203: Raise the periodic root-info wait message from DEBUG to LOG_INFO_V0
in both wait_for_rootinfo implementations:
src/a2a3/platform/onboard/host/comm_hccl.cpp lines 203-203 and
src/a5/platform/onboard/host/comm_hccl.cpp lines 208-208. Preserve the existing
message and timing behavior while ensuring it remains visible with DEBUG
disabled.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6204ff88-2d61-4963-b363-d8f7b97adb75

📥 Commits

Reviewing files that changed from the base of the PR and between 22f2d53 and 2c1b192.

📒 Files selected for processing (41)
  • src/a2a3/platform/onboard/aicpu/kernel.cpp
  • src/a2a3/platform/onboard/host/comm_hccl.cpp
  • src/a2a3/platform/onboard/host/device_runner.cpp
  • src/a2a3/platform/onboard/host/host_regs.cpp
  • src/a2a3/platform/shared/aicpu/pmu_collector_aicpu.cpp
  • src/a2a3/platform/shared/host/pmu_collector.cpp
  • src/a2a3/platform/sim/host/device_runner.cpp
  • src/a2a3/runtime/host_build_graph/aicpu/aicpu_executor.cpp
  • src/a2a3/runtime/host_build_graph/host/runtime_maker.cpp
  • src/a2a3/runtime/host_build_graph/runtime/orchestrator_core/pto_orchestrator.cpp
  • src/a2a3/runtime/host_build_graph/runtime/scheduler/pto_scheduler.cpp
  • src/a2a3/runtime/host_build_graph/runtime/scheduler/scheduler_cold_path.cpp
  • src/a2a3/runtime/host_build_graph/runtime/scheduler/scheduler_dispatch.cpp
  • src/a2a3/runtime/host_build_graph/runtime/shared/pto_shared_memory.cpp
  • src/a2a3/runtime/host_build_graph/runtime/shared/pto_tensormap.cpp
  • src/a2a3/runtime/tensormap_and_ringbuffer/aicpu/aicpu_executor.cpp
  • src/a2a3/runtime/tensormap_and_ringbuffer/host/runtime_maker.cpp
  • src/a2a3/runtime/tensormap_and_ringbuffer/runtime/pto_orchestrator.cpp
  • src/a2a3/runtime/tensormap_and_ringbuffer/runtime/scheduler/pto_scheduler.cpp
  • src/a2a3/runtime/tensormap_and_ringbuffer/runtime/scheduler/scheduler_cold_path.cpp
  • src/a2a3/runtime/tensormap_and_ringbuffer/runtime/scheduler/scheduler_completion.cpp
  • src/a2a3/runtime/tensormap_and_ringbuffer/runtime/scheduler/scheduler_dispatch.cpp
  • src/a2a3/runtime/tensormap_and_ringbuffer/runtime/shared/pto_shared_memory.cpp
  • src/a2a3/runtime/tensormap_and_ringbuffer/runtime/shared/pto_tensormap.cpp
  • src/a5/platform/onboard/aicpu/kernel.cpp
  • src/a5/platform/onboard/host/comm_hccl.cpp
  • src/a5/platform/onboard/host/device_runner.cpp
  • src/a5/platform/onboard/host/host_regs.cpp
  • src/a5/platform/shared/aicpu/pmu_collector_aicpu.cpp
  • src/a5/platform/shared/host/pmu_collector.cpp
  • src/a5/platform/sim/host/device_runner.cpp
  • src/a5/runtime/tensormap_and_ringbuffer/aicpu/aicpu_executor.cpp
  • src/a5/runtime/tensormap_and_ringbuffer/host/runtime_maker.cpp
  • src/a5/runtime/tensormap_and_ringbuffer/runtime/pto_orchestrator.cpp
  • src/a5/runtime/tensormap_and_ringbuffer/runtime/scheduler/pto_scheduler.cpp
  • src/a5/runtime/tensormap_and_ringbuffer/runtime/scheduler/scheduler_cold_path.cpp
  • src/a5/runtime/tensormap_and_ringbuffer/runtime/scheduler/scheduler_completion.cpp
  • src/a5/runtime/tensormap_and_ringbuffer/runtime/scheduler/scheduler_dispatch.cpp
  • src/a5/runtime/tensormap_and_ringbuffer/runtime/shared/pto_shared_memory.cpp
  • src/a5/runtime/tensormap_and_ringbuffer/runtime/shared/pto_tensormap.cpp
  • src/common/platform/onboard/host/device_runner_base.cpp
💤 Files with no reviewable changes (10)
  • src/a2a3/runtime/host_build_graph/aicpu/aicpu_executor.cpp
  • src/a5/platform/onboard/aicpu/kernel.cpp
  • src/a5/platform/onboard/host/device_runner.cpp
  • src/common/platform/onboard/host/device_runner_base.cpp
  • src/a2a3/platform/onboard/host/device_runner.cpp
  • src/a2a3/platform/shared/host/pmu_collector.cpp
  • src/a2a3/platform/onboard/aicpu/kernel.cpp
  • src/a5/platform/sim/host/device_runner.cpp
  • src/a5/platform/shared/host/pmu_collector.cpp
  • src/a2a3/platform/sim/host/device_runner.cpp

Comment thread src/a2a3/platform/onboard/host/comm_hccl.cpp Outdated
@ChaoZheng109
ChaoZheng109 force-pushed the issue-1428-strip-all-logs branch from 2c1b192 to 52b6f80 Compare July 27, 2026 01:49
Trim low-signal LOG_* call sites across the runtime and platform layers,
keeping the diagnostics that trace program flow or failures:

- Flow / lifecycle / summary logs kept at INFO; per-item (per-tensor,
  per-arg) detail demoted to LOG_DEBUG; failure paths stay LOG_ERROR /
  LOG_WARN. Loader / device-runner load-path diagnostics kept at their
  original levels.
- AICPU hot paths (per-task / per-scope dispatch loops) carry no logs
  (codestyle rule 7); DFX collectors keep their buffer-level init/flush
  diagnostics and telemetry counters.
- STRACE, LOG_RUNTIME_FAILURE and ACL logging left untouched.
- Log-only support removed with its logs (bookkeeping counters, dump
  scaffolding); genuine out-of-scope strip collateral restored
  (unused-parameter removals, blank-line deletions).

Rebased onto upstream/main; dense dependency diagnostics follow upstream's
debug-only / removed decisions (hw-native-sys#1448), completion follows the polling
mechanism (hw-native-sys#1435).

Co-Authored-By: vegetabledoww <114059112+vegetabledoww@users.noreply.github.com>
@ChaoZheng109

Copy link
Copy Markdown
Collaborator Author

Performance impact — no measurable change

Same-device serial benchmark on NPU device 8 (eliminates the device-to-device / neighbor-contention variance of a cross-device run), a2a3 / tensormap_and_ringbuffer, 8 examples × 100 rounds.

Base (22f2d533, = upstream/main) → HEAD (log-curation PR)

Average change per metric

Metric Avg Δ Range
Host +0.52% [−1.4%, +2.3%]
Device +0.42% [−2.1%, +5.1%]
Effective +0.46% [−2.0%, +5.3%]
Orch +0.75% [−4.0%, +8.9%]
Sched +0.41% [−2.2%, +5.3%]

Per-example Effective (µs)

Example Base HEAD Δ%
alternating_matmul_add 787.4 789.4 +0.3%
benchmark_bgemm 715.9 717.7 +0.3%
paged_attention_unroll (C1) 1096.3 1093.5 −0.3%
paged_attention_unroll (C2) 559.8 589.7 +5.3%
paged_attention_unroll_manual_scope (C1) 1085.0 1085.3 +0.0%
paged_attention_unroll_manual_scope (C2) 563.3 551.8 −2.0%
batch_paged_attention 3399.0 3404.0 +0.1%
qwen3_14b_decode (StressBatch16Seq3500) 2087.6 2087.5 −0.0%

Conclusion: all metrics move < 1% on average — within measurement noise. 6/8 examples are in noise; the two outliers are the smallest Case2 cases (~560 µs) moving in opposite directions (+5.3% / −2.0%), i.e. run-to-run jitter, not a systematic change. Expected for a logging-only change: default-off logs, STRACE and AICPU hot paths untouched.

@ChaoZheng109
ChaoZheng109 merged commit f7909e2 into hw-native-sys:main Jul 27, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant