Skip to content

feat: add Ascend950 direct SDMA backend - #84

Closed
Kur0x wants to merge 1 commit into
codex/ccu-stack-10-ci-cleanupfrom
codex/a5-direct-sdma
Closed

feat: add Ascend950 direct SDMA backend#84
Kur0x wants to merge 1 commit into
codex/ccu-stack-10-ci-cleanupfrom
codex/a5-direct-sdma

Conversation

@Kur0x

@Kur0x Kur0x commented Jul 29, 2026

Copy link
Copy Markdown
Member

Summary

  • add a runtime-selected Ascend950/A5 SDMA backend using CANN's built-in ShmemSdmaStarsQuery, 48 STARS channels, Host RTSQ mappings, and direct two-SQE AIV submission
  • preserve the existing A2/A3 PTO path and best-effort communicator behavior, including retryable resource cleanup and per-communicator failure isolation
  • migrate the supported driver floor to 25.1.rc1, extend the SDMA demo/tests and CI with an Ascend950 compile-only gate, and update both the draw.io source and exported SVG

Validation

  • python3 -m unittest discover -s tests/ci -p 'test_*.py': 141 passed, 1 skipped
  • ruby tests/ci/test_workflows.rb: passed
  • bash tests/ci/test_common_env_override.sh: passed
  • C++14 compile and execution: SDMA metadata, A5 query validation, communicator wiring, and source guard tests passed
  • bash syntax checks, git diff --check, and draw.io/SVG XML validation passed
  • exported architecture SVG visually inspected; no clipping or layout regressions
  • independent code review completed after fixes; final focused review reported no findings

Remaining Validation

  • a full CANN 9.1 Host build and dav-3510 compile must run in CI; the local macOS workspace has no CANN installation
  • the documented Ascend950 data-plane matrix was not rerun in this task because the validation host was unavailable
  • the approved plan's fully injectable Host runtime failure matrix is not yet implemented; this PR remains draft until that gap and CI results are resolved

Stack

@Kur0x
Kur0x marked this pull request as ready for review July 29, 2026 03:48
@Kur0x
Kur0x requested a review from a team as a code owner July 29, 2026 03:48
@Kur0x

Kur0x commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

Superseded by #85, rebuilt directly on origin/main so the PR contains no CCU stack commits.

@Kur0x Kur0x closed this Jul 29, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 454cb7ffce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const aclError destroyStatus = isolated == nullptr
? ACL_SUCCESS
: aclrtDestroyContext(isolated);
isolated = nullptr;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Retain isolated contexts when destruction fails

If aclrtDestroyContext(isolated) returns an error, this unconditionally discards the only handle to the potentially live query context. The caller then falls back without SDMA and cannot retry cleanup, so repeated communicator initialization under a transient runtime cleanup failure can leak contexts and eventually exhaust device resources, undermining the required best-effort fallback. Keep the handle until destruction succeeds or transfer it to retryable backend state.

AGENTS.md reference: AGENTS.md:L51-L51

Useful? React with 👍 / 👎.

for bytes in "${SIZES[@]}"; do
echo "---- bytes=${bytes} ----"
"${bin}" "${bytes}"
for ((repeat = 1; repeat <= REPEATS; ++repeat)); do

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject zero repeat counts before running the matrix

When TILEXR_SDMA_DEMO_REPEATS is 0 or negative, this loop executes no demo invocation and the runner exits successfully, allowing hardware automation to record a passing SDMA matrix without testing any transfer. Validate REPEATS as a positive integer before entering the loop.

Useful? React with 👍 / 👎.

}

std::cout << "PASS TileXR SDMA copied " << bytes << " bytes correctly" << std::endl;
std::cout << "PASS TileXR SDMA copied " << bytes << " bytes on " << blocks

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Fail the demo when communicator teardown fails

The new A5 teardown path can make TileXRCommDestroy return an error while retaining the communicator, but Cleanup discards that result and this path still prints PASS and returns zero. Thus an unmap, stream-destroy, or context-restore failure can be reported as a successful lifecycle validation before the process resets the device, preventing the promised retry; propagate cleanup status into the demo result.

Useful? React with 👍 / 👎.

std::vector<uint8_t> hostSrc(bytes);
std::vector<uint8_t> hostDst(bytes, 0);
std::vector<int32_t> hostDebug(kDebugWords, 0);
std::vector<uint8_t> hostSrc(totalBytes);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Give each source block a distinct validation pattern

For the new multi-block mode, FillPattern repeats every 256 bytes, so documented block sizes such as 4 KiB give every source block identical contents. A source-address or block-routing defect that copies block 0 into another block's destination can therefore still satisfy the full-buffer equality check; seed the pattern with the block index or otherwise make each block distinct.

Useful? React with 👍 / 👎.

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