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

[Feature Request] Mapping User Buffers to NPU address space using RegisterBufferAttribute #23457

Open
ashrit-ms opened this issue Jan 22, 2025 · 1 comment
Assignees
Labels
ep:QNN issues related to QNN exeution provider feature request request for unsupported feature or enhancement

Comments

@ashrit-ms
Copy link

Describe the feature request

When analyzing performance on QNN EP we noticed that for each inference a memcpy is being made for the input buffer and the output buffer.

INPUT: ORT Buffer copied into RPC Buffer.
OUPUT: RPC Buffer copied into ORT Buffer.

Currently, the only way to avoid any copies is for the APP to use QNN-EP Allocator to allocate memory using RpcMemAlloc but that might not always be possible.

The ask is to avoid the copy between ORT Buffer and RPC Buffer by mapping the ORT Buffer into the NPU address space using RegisterBufferAttribute API.

Describe scenario use case

An application can malloc input and output buffers and then call CreateTensorWithDataAsOrtValue() on said buffers.

QNN-EP can then call RegisterBufferAttribute on these CPU buffers to map them to the NPU address space.

@ashrit-ms ashrit-ms added the feature request request for unsupported feature or enhancement label Jan 22, 2025
@github-actions github-actions bot added the ep:QNN issues related to QNN exeution provider label Jan 22, 2025
@edgchen1
Copy link
Contributor

The ask is to avoid the copy between ORT Buffer and RPC Buffer by mapping the ORT Buffer into the NPU address space using RegisterBufferAttribute API.

Is there any documentation for this RegisterBufferAttribute API?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ep:QNN issues related to QNN exeution provider feature request request for unsupported feature or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants