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

Memory Mapped Buffers #197

Open
tjablin opened this issue Feb 6, 2021 · 1 comment
Open

Memory Mapped Buffers #197

tjablin opened this issue Feb 6, 2021 · 1 comment

Comments

@tjablin
Copy link
Collaborator

tjablin commented Feb 6, 2021

Consider a batch one inference system where input activations are mapped in host DRAM are mapped into the device's address space on demand using an ioctl. The device driver is optimized for the case where a single buffer is reused for many inferences. In order to avoid unnecessary ioctl's, the device driver checks if the buffer is already mapped, skipping the ioctl for the common case of buffer reuse. Is 'caching' pointers for the purpose of avoiding ioctls allowed in MLPerf?

I think the answer is 'Yes.' My reasoning is as follows:

  1. In a real application, most users would copy activations into a re-usable buffer and avoid the ioctl.
  2. The data still starts in host DRAM.
  3. If the shared memory were managed by the user instead, the user could achieve the same affect by loading the dataset into a manually allocated a shared buffer. The driver's 'caching' just accomplishes automatically, what the user could have done manually.
@DilipSequeira
Copy link
Contributor

I agree. This class of system programming optimizations apply to generic (broader than ML) accelerators, and it would be counterproductive to exclude them.

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

No branches or pull requests

2 participants