Skip to content

Conversation

junpi3
Copy link
Contributor

@junpi3 junpi3 commented Aug 30, 2024

Stack from ghstack (oldest at bottom):

StagingBuffers are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, persistently map the memory once on model load.

Differential Revision: D59706627

Jorge Pineda added 6 commits August 30, 2024 15:08
1. Tensors accessible to both CPU and GPU use `StorageBuffer`.
2. Tensors accessible to GPU only use `vTensorStorage`.

Since `StorageBuffer` is only used for [staging buffers](https://vulkan-tutorial.com/Vertex_buffers/Staging_buffer), i.e., buffers accessible to both CPU and GPU, `StagingBuffer` is a fitting name for (1) that decreases confusion between (1) and (2).

Differential Revision: [D62049779](https://our.internmc.facebook.com/intern/diff/D62049779/)

[ghstack-poisoned]
There are ~4 lines of duplicated code but IMO, the distinct function names make the code much clearer.

Differential Revision: [D62049778](https://our.internmc.facebook.com/intern/diff/D62049778/)

[ghstack-poisoned]
…on methods"

There are ~4 lines of duplicated code but IMO, the distinct function names make the code much clearer.

Differential Revision: [D62049778](https://our.internmc.facebook.com/intern/diff/D62049778/)

[ghstack-poisoned]
`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)

[ghstack-poisoned]
There are ~4 lines of duplicated code but IMO, the distinct function names make the code much clearer.

Differential Revision: [D62049778](https://our.internmc.facebook.com/intern/diff/D62049778/)

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Aug 30, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/5021

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 0bd4b96 with merge base 3cf9237 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 30, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D59706627

junpi3 pushed a commit that referenced this pull request Aug 30, 2024
`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)

ghstack-source-id: 233620788
Pull Request resolved: #5021
`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D59706627

junpi3 pushed a commit that referenced this pull request Sep 3, 2024
Pull Request resolved: #5021



`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.
ghstack-source-id: 240798121
@exported-using-ghexport

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)
Jorge Pineda added 2 commits September 3, 2024 10:19
`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)

[ghstack-poisoned]
`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D59706627

junpi3 pushed a commit that referenced this pull request Sep 3, 2024
Pull Request resolved: #5021



`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.
ghstack-source-id: 240813745
@exported-using-ghexport

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)
@junpi3 junpi3 changed the base branch from gh/jorgep31415/109/base to gh/jorgep31415/108/head September 3, 2024 17:20
Jorge Pineda added 2 commits September 3, 2024 10:36
`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)

[ghstack-poisoned]
`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D59706627

junpi3 pushed a commit that referenced this pull request Sep 3, 2024
Pull Request resolved: #5021



`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.
ghstack-source-id: 240814116
@exported-using-ghexport

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)
Jorge Pineda added 2 commits September 3, 2024 10:40
`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)

[ghstack-poisoned]
`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D59706627

junpi3 pushed a commit that referenced this pull request Sep 3, 2024
Pull Request resolved: #5021



`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.
ghstack-source-id: 240818434
@exported-using-ghexport

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)
Jorge Pineda added 2 commits September 3, 2024 11:30
`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)

[ghstack-poisoned]
`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)

[ghstack-poisoned]
junpi3 pushed a commit that referenced this pull request Sep 3, 2024
Pull Request resolved: #5021



`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.
ghstack-source-id: 240831447
@exported-using-ghexport

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D59706627

Base automatically changed from gh/jorgep31415/108/head to main September 3, 2024 19:30
Jorge Pineda added 2 commits September 4, 2024 12:20
`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)

[ghstack-poisoned]
`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D59706627

junpi3 pushed a commit that referenced this pull request Sep 4, 2024
Pull Request resolved: #5021



`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.
ghstack-source-id: 241025872
@exported-using-ghexport

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)
Jorge Pineda added 2 commits September 4, 2024 13:52
`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)

[ghstack-poisoned]
`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)

[ghstack-poisoned]
junpi3 pushed a commit that referenced this pull request Sep 4, 2024
Pull Request resolved: #5021



`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.
ghstack-source-id: 241047807
@exported-using-ghexport

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D59706627

Jorge Pineda added 2 commits September 4, 2024 13:57
`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)

[ghstack-poisoned]
`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)

[ghstack-poisoned]
junpi3 pushed a commit that referenced this pull request Sep 4, 2024
Pull Request resolved: #5021



`StagingBuffer`s are used for input, output, and constant tensors. For input and output, they are mapped every inference which is unnecessary. Instead, [persistently map the memory](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/memory_mapping.html) once on model load.
ghstack-source-id: 241050420
@exported-using-ghexport

Differential Revision: [D59706627](https://our.internmc.facebook.com/intern/diff/D59706627/)
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D59706627

@facebook-github-bot facebook-github-bot merged commit 3716680 into main Sep 4, 2024
37 of 38 checks passed
@facebook-github-bot facebook-github-bot deleted the gh/jorgep31415/109/head branch September 4, 2024 22:19
junpi3 pushed a commit that referenced this pull request Sep 9, 2024
I missed migration of this callsite in #5021

Differential Revision: [D62403691](https://our.internmc.facebook.com/intern/diff/D62403691/)

[ghstack-poisoned]
@junpi3 junpi3 mentioned this pull request Sep 9, 2024
junpi3 pushed a commit that referenced this pull request Sep 9, 2024
I missed migration of this callsite in #5021

Differential Revision: [D62403691](https://our.internmc.facebook.com/intern/diff/D62403691/)

ghstack-source-id: 241692821
Pull Request resolved: #5202
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants