Skip to content

fix(npu): add Ascend CPU fallback for COO ops and fix segment_reduce stream - #18

Open
xuejiakn wants to merge 1 commit into
BUPT-GAMMA:masterfrom
xuejiakn:fix/coo-cpu-fallback
Open

fix(npu): add Ascend CPU fallback for COO ops and fix segment_reduce stream#18
xuejiakn wants to merge 1 commit into
BUPT-GAMMA:masterfrom
xuejiakn:fix/coo-cpu-fallback

Conversation

@xuejiakn

Copy link
Copy Markdown

Summary

Add Ascend CPU fallback for COO-format ops and fix segment_reduce stream sync.

Changes

  • src/array/array.cc: COO ops CPU fallback dispatch
  • src/array/ascend/segment_reduce.cc: stream sync fix
  • src/graph/unit_graph.cc: COO fallback integration

Restructure note

Replaces #14[4] and #15[7] (identical).

…stream

- array.cc: add CPU fallback with aclrtSynchronizeDevice() for 5 COO operations
  that previously only dispatched to CPU/CUDA (not Ascend):
  - COOGetRowNNZ (scalar + array)
  - COOGetRowDataAndIndices
  - COOSliceRows(NDArray)
  - COOSort_
  - Also add aclrtSynchronizeDevice() to existing COOGetDataAndIndices/COOGetData
- segment_reduce.cc:
  - Use default stream (nullptr) instead of custom stream
  - Use synchronous aclrtMemcpy instead of aclrtMemcpyAsync
  - Add aclrtSynchronizeDevice() at entry to ensure PyTorch ops complete
- unit_graph.cc: InEdges() prefers COO format on Ascend to avoid CSR kernel
  stream sync issues (COO InEdges uses CPU fallback which is more reliable)
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