Skip to content

[Ascend] Support partial L0 copies with explicit stride - #3

Closed
Denverjin wants to merge 6 commits into
mainfrom
ascend-partial-l0-copy
Closed

Denverjin wants to merge 6 commits into
mainfrom
ascend-partial-l0-copy

Conversation

@Denverjin

Copy link
Copy Markdown
Owner

Summary

Allow multiple L1-to-L0A/L0B copies to assemble one GEMM tile, including transposed MajorK/MajorMN loads. Previously, nonzero destination origins were rejected, and each copy derived its compact pitch from its own region.

  • Add an Ascend-only T.copy(..., stride=...) argument for the L0 pitch in 16-element M/N fractal blocks. The caller supplies the consuming GEMM's pitch; omitting it preserves compact-region behavior. L0C-to-UB/GM copies also accept an explicit source pitch.
  • Support aligned destination offsets, validate fractal alignment and physical write bounds, and map offsets using the copy pitch while preserving allocation and buffer-version spacing.
  • Keep BufferRegion access tracking. L0 matrix regions may overlap unless their pitches are provably equal; dependency and lifetime analysis account for fractal padding.

Validation

  • Incremental Ascend native build passed.
  • 585 host tests passed across copy/GEMM lowering, fractal storage normalization, and AutoSchedule (excluding the two device integration suites).
  • 14 NPU tests passed on Ascend 950 (dav-3510), covering partial copies, transposed loads, effective-K tails, dynamic pitches, overwrites, and buffer versions.
  • Scoped pre-commit checks and git diff --check passed.

Validation was performed on head 9ec2c59; the merge with the latest main has not been tested.

@Denverjin Denverjin closed this Oct 14, 2026
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