Skip to content

Add: test_vector_example.py for a5 tensormap_and_ringbuffer#727

Merged
ChaoZheng109 merged 1 commit intohw-native-sys:mainfrom
zhusy54:a5case
May 9, 2026
Merged

Add: test_vector_example.py for a5 tensormap_and_ringbuffer#727
ChaoZheng109 merged 1 commit intohw-native-sys:mainfrom
zhusy54:a5case

Conversation

@zhusy54
Copy link
Copy Markdown
Contributor

@zhusy54 zhusy54 commented May 9, 2026

Summary

  • Add test_vector_example.py for a5 tensormap_and_ringbuffer runtime
  • Mirror of the a2a3 version; only difference is platforms field uses ["a5sim", "a5"] instead of ["a2a3sim", "a2a3"]

Testing

  • Simulation tests pass (a5sim)
  • Hardware tests pass (a5)

Related Issues

N/A

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

Mirror of the a2a3 version; only difference is platforms field
uses ["a5sim", "a5"] instead of ["a2a3sim", "a2a3"].
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 new test case, TestVectorExample, for the tensormap-and-ringbuffer runtime, implementing the calculation f = (a+b+1)*(a+b+2) + (a+b). A review comment suggests reducing the block_dim from 3 to 1, as the current orchestration logic does not appear to support data partitioning, which could lead to redundant execution or race conditions for the 128x128 tile size.

{
"name": "default",
"platforms": ["a5sim", "a5"],
"config": {"aicpu_thread_num": 4, "block_dim": 3},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The block_dim is set to 3, but the orchestration logic in example_orchestration.cpp and the associated kernels do not appear to implement any data partitioning or parallelization across multiple blocks. For a single-tile operation of size 128x128, block_dim should be set to 1 to avoid redundant execution and potential race conditions when writing to the output tensor.

Suggested change
"config": {"aicpu_thread_num": 4, "block_dim": 3},
"config": {"aicpu_thread_num": 4, "block_dim": 1},

@ChaoZheng109 ChaoZheng109 merged commit d9dfb46 into hw-native-sys:main May 9, 2026
13 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.

2 participants