Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove (X, Y) coordinates from NpuDmaMemcpyNdOp #1971

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

pvasireddy-amd
Copy link
Collaborator

@pvasireddy-amd pvasireddy-amd commented Dec 12, 2024

Issue #1964
Requires #1997

This PR fixes an issue where the X and Y input attributes of the NpuDmaMemcpyNdOp given through the python bindings were always (0, 0), which may not be the coordinates of the Shim tile that the operation will be mapped to (and were not intended to represent that, by design). Instead, the lowering uses the metadata input of the NpuDmaMemcpyNdOp to find the corresponding ShimDMAAllocationOp. As this operation has the column coordinate (and the row coordinate is implicit for Shim tiles) this PR removes the X and Y coordinates from the NpuDmaMemcpyNdOp altogether and fully relies on the metadata to find the information.

Copy link
Contributor

github-actions bot commented Dec 13, 2024

Coverage Report

Created: 2024-12-16 17:03

Click here for information about interpreting this report.

FilenameFunction CoverageLine CoverageRegion CoverageBranch Coverage
Totals- - - -
Generated by llvm-cov -- llvm version 14.0.0

@pvasireddy-amd pvasireddy-amd changed the title npu1 vs npu1_4col issue [TEST] Throws runtime error when using tiles in columns other than column 0 without defining a tile for column 0. Dec 13, 2024
@pvasireddy-amd pvasireddy-amd changed the title [TEST] Throws runtime error when using tiles in columns other than column 0 without defining a tile for column 0. [TEST] Throws error when using tiles in columns other than column 0 without defining a tile for column 0. Dec 13, 2024
@pvasireddy-amd pvasireddy-amd changed the title [TEST] Throws error when using tiles in columns other than column 0 without defining a tile for column 0. [TEST] Issue #1964 Dec 13, 2024
@pvasireddy-amd
Copy link
Collaborator Author

pvasireddy-amd commented Dec 13, 2024

Debug status:

  1. Error occurs when changing the device name from npu1_1col to npu1 while trying to perform a passthrough from ShimTile (0,0) to ComputeTile (0,2). This results in the following error: aiex.npu.dma_memcpy_nd' op Unsupported tile type at (0,0). Must be ShimNOC, Mem, or Core. This happens because getX() and getY() are used instead of the column and row information, which should be obtained from the metadata of dma_memcpy_nd in this line. Tile (0,0) is considered a ShimPLTile when the entire NPU is used, but this check needs to be moved since the row and column information is not available at the NpuDmaMemcpyNd stage.
  2. The second case involves changing both the ShimTile and ComputeTile to columns other than the zeroth column and using the appropriate device name for the same passthrough example. This results in a runtime error. One temporary workaround is to declare at least one tile (which can be either a ShimTile, MemTile, or ComputeTile with an empty body) in the zeroth column, and the test passes. The reason for this dependency on the zeroth column is unclear.

abisca and others added 7 commits December 16, 2024 09:42
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
abisca and others added 9 commits December 19, 2024 03:58
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@AndraBisca AndraBisca changed the title [TEST] Issue #1964 Remove X, Y inputs from NpuDmaMemcpyNdOp Dec 22, 2024
@AndraBisca AndraBisca changed the title Remove X, Y inputs from NpuDmaMemcpyNdOp Remove (X, Y) coordinates from NpuDmaMemcpyNdOp Dec 22, 2024
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.

4 participants