Skip to content

feat: support selective tensor dump by tensor argument#844

Open
zmnobug wants to merge 1 commit into
hw-native-sys:mainfrom
zmnobug:feature/838-partial-task-tensor-dump
Open

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

Conversation

@zmnobug
Copy link
Copy Markdown

@zmnobug zmnobug commented May 22, 2026

Summary

  • Add rt_tensor_dump_selective() to enable selective tensor dump mode.
  • Add Arg::dump(...) to select specific tensor arguments in a task.
  • Carry selected tensor argument masks through task payloads and dump records.
  • Filter unmarked tasks and unselected tensor args at AICPU collection time while preserving legacy full-dump behavior by default.
  • 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/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
#include <stdbool.h>
#endif

#ifndef TENSOR_DUMP_AICPU_CONTROL_ONLY
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

不用这种宏隔离

@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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

刚刚的评论的那一行,是指不用那一个单独的dump宏,__cplusplus还是需要的,这里也不用新增一个文件把接口拿出来

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

已修复

  - Add platform-owned selective tensor dump controls
  - Add Arg::dump(...) to mark tensor arguments for task-level dump
  - Carry dump argument masks through task payloads and dump records
  - Skip unmarked tasks and unselected tensor args during AICPU collection
  - Add selective tensor dump regression coverage and documentation
@zmnobug zmnobug force-pushed the feature/838-partial-task-tensor-dump branch from fd0f1dc to 7e4ad76 Compare May 25, 2026 07:14
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