Skip to content

feat: support selective tensor dump by tensor argument#844

Merged
ChaoZheng109 merged 1 commit into
hw-native-sys:mainfrom
zmnobug:feature/838-partial-task-tensor-dump
May 26, 2026
Merged

feat: support selective tensor dump by tensor argument#844
ChaoZheng109 merged 1 commit into
hw-native-sys:mainfrom
zmnobug:feature/838-partial-task-tensor-dump

Conversation

@zmnobug
Copy link
Copy Markdown
Contributor

@zmnobug zmnobug commented May 22, 2026

Summary

  • Add enable_dump_tensor_selective() to enable selective tensor dump mode from orchestration.
    • Add Arg::dump(...) to select specific tensor arguments in a task.
    • Store selected tensor argument masks in platform-side AICPU state keyed by task id, without extending PTO2TaskPayload.
    • Filter unmarked tasks and unselected tensor args at AICPU collection time while preserving legacy full-dump behavior by default.
    • Clear selective dump mask state when tensor dump is initialized for a new run.
    • Add partial tensor dump regression coverage and update tensor dump documentation.

Testing

  • a2a3sim build
  • a5sim build
  • a2a3 onboard build
  • TestTensorDump::default --dump-tensor
  • TestTensorDumpPartial::default --dump-tensor

Fixes #838

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a selective tensor dump feature, allowing users to dump inputs and outputs for specific tasks by enabling a selective mode and marking individual tasks. The implementation adds bitmask-based request flags to task metadata and updates the AICPU collection logic to filter tasks accordingly. Review feedback suggests adding defensive null checks for the runtime context in the orchestration API to prevent potential crashes and using bitwise OR assignment for consistency in setting dump requests to avoid accidentally clearing flags.

Comment thread src/a2a3/runtime/tensormap_and_ringbuffer/orchestration/pto_orchestration_api.h Outdated
Comment thread src/a5/runtime/tensormap_and_ringbuffer/orchestration/pto_orchestration_api.h Outdated
Comment thread src/a2a3/runtime/tensormap_and_ringbuffer/runtime/pto_types.h Outdated
Comment thread src/a5/runtime/tensormap_and_ringbuffer/runtime/pto_types.h Outdated
@zmnobug zmnobug force-pushed the feature/838-partial-task-tensor-dump branch 2 times, most recently from b76483f to 7c039c7 Compare May 25, 2026 02:32
@zmnobug zmnobug changed the title feat: support selective tensor dump by task feat: support selective tensor dump by tensor argument May 25, 2026
@zmnobug zmnobug force-pushed the feature/838-partial-task-tensor-dump branch from 7c039c7 to 078a128 Compare May 25, 2026 04:49
Comment thread src/a2a3/platform/include/aicpu/tensor_dump_aicpu.h Outdated
@zmnobug zmnobug force-pushed the feature/838-partial-task-tensor-dump branch 2 times, most recently from d63722e to fd0f1dc Compare May 25, 2026 06:44
Comment thread src/a2a3/platform/include/aicpu/tensor_dump_control_aicpu.h Outdated
@zmnobug zmnobug force-pushed the feature/838-partial-task-tensor-dump branch 11 times, most recently from 07f6103 to c4071c7 Compare May 26, 2026 12:36
  - Add Arg::dump(...) for selecting tensor arguments to dump within a task
  - Keep selective dump masks in a platform-owned table instead of expanding PTO2TaskPayload
  - Filter unmarked tasks and unselected tensor arguments at AICPU dump collection time
  - Preserve legacy full tensor dump behavior when selective mode is not enabled
  - Add partial tensor dump regression coverage and update tensor dump documentation
@zmnobug zmnobug force-pushed the feature/838-partial-task-tensor-dump branch from c4071c7 to 536fa1b Compare May 26, 2026 12:55
@ChaoZheng109
Copy link
Copy Markdown
Collaborator

fixed #860

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.

[Feature] Support partial task selection for tensor dump

2 participants