Skip to content

[Code Health] Rename internal TensorDump implementation to ArgsDump #1252

Description

@ChaoZheng109

Category

Naming / Consistency

Component

Platform (a2a3 / a2a3sim)

Description

The public dump surface has been renamed from tensor dump to args dump, but the internal C++ implementation still uses the old TensorDump* naming throughout the collector, platform headers, AICPU helpers, and CMake source paths.

This is naming drift left after the public-surface rename work:

The mismatch makes the code harder to navigate and keeps reintroducing ambiguity in docs, issue text, and DFX tooling work. The feature semantics are now per-task argument dump, including tensor and scalar args, so the internal names should match the public contract.

Related: #837, #995, #1247

Location

Representative locations:

  • src/common/platform/shared/host/tensor_dump_collector.cpp
  • src/common/platform/include/host/tensor_dump_collector.h
  • src/common/platform/include/aicpu/tensor_dump_aicpu.h
  • src/common/platform/shared/aicpu/tensor_dump_aicpu.cpp
  • src/a2a3/platform/include/common/tensor_dump.h
  • src/a5/platform/include/common/tensor_dump.h
  • src/{a2a3,a5}/platform/{onboard,sim}/host/CMakeLists.txt
  • src/{a2a3,a5}/platform/{onboard,sim}/host/device_runner.{h,cpp}
  • src/{a2a3,a5}/runtime/** includes of aicpu/tensor_dump_aicpu.h
  • docs/comments that still refer to internal TensorDump* names where they describe args-dump behavior

Proposed Fix

Do a mechanical internal rename from tensor dump to args dump across code, build files, tests, and docs/comments, while preserving on-disk public artifacts that are already correct:

  • TensorDumpCollector -> ArgsDumpCollector
  • TensorDumpRecord / TensorDumpInfo / TensorDumpRole / TensorDumpStage / TensorDumpKind -> corresponding ArgsDump* names
  • DumpTensorLevel / dump_tensor_level -> DumpArgsLevel / dump_args_level
  • tensor_dump_collector.* -> args_dump_collector.*
  • tensor_dump_aicpu.* -> args_dump_aicpu.*
  • common/tensor_dump.h -> common/args_dump.h
  • constants/macros such as TENSOR_DUMP_* -> ARGS_DUMP_*
  • function names such as init_tensor_dump where they initialize args dump rather than tensor-info dump APIs

Keep compatibility aliases only where needed for external or serialized contracts; otherwise prefer removing stale internal names outright.

Because this touches shared platform/runtime headers and onboard code, validate at least the args-dump smoke test after the rename and rebuild runtimes.

Priority

Medium (minor risk, should fix in next few releases)

Metadata

Metadata

Assignees

Labels

code healthTechnical debt, robustness, code quality

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions