Skip to content

[ET-VK] Introduce ParamsBindList to prevent needing to pass shared_ptr to bind parameter UBOs #3150

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

Closed
wants to merge 2 commits into from

Conversation

SS-JIA
Copy link
Contributor

@SS-JIA SS-JIA commented Apr 19, 2024

Stack from ghstack (oldest at bottom):

Context

In keeping with the below changeset in this stack, this diff introduces the ParamsBindList structure to avoid storing shared pointers to api::UniformParamsBuffer objects in ExecuteNode and PrepackNode.

The idea is to store the binding information of each UPB instead of taking ownership of the UPB itself. There isn't really a need for ExecuteNode and PrepackNode to take ownership since ComputeGraph provides a guarantee that the UPBs will be in scope at the time of binding.

With this change, all shared_ptr members can be eliminated from vTensor, further reducing heap allocations and pointer chasing.

In the future I will change prepack_nodes_ and execute_nodes_ to store PrepackNode and ExecuteNode instances directly instead of storing unique pointers to them.

Differential Revision: D56357188

…_ptr` to bind parameter UBOs

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

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Apr 19, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit 91751a3 with merge base 269b6ad (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 Apr 19, 2024
@facebook-github-bot
Copy link
Contributor

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

SS-JIA added a commit that referenced this pull request Apr 19, 2024
…_ptr` to bind parameter UBOs

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

ghstack-source-id: 223199138
Pull Request resolved: #3150
…ass `shared_ptr` to bind parameter UBOs"


## Context

In keeping with the below changeset in this stack, this diff introduces the `ParamsBindList` structure to avoid storing shared pointers to `api::UniformParamsBuffer` objects in `ExecuteNode` and `PrepackNode`.

The idea is to store the binding information of each UPB instead of taking ownership of the UPB itself. There isn't really a need for `ExecuteNode` and `PrepackNode` to take ownership since `ComputeGraph` provides a guarantee that the UPBs will be in scope at the time of binding.

With this change, all `shared_ptr` members can be eliminated from `vTensor`, further reducing heap allocations and pointer chasing.

In the future I will change `prepack_nodes_` and `execute_nodes_` to store `PrepackNode` and `ExecuteNode` instances directly instead of storing unique pointers to them.


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

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

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

SS-JIA added a commit that referenced this pull request Apr 19, 2024
…_ptr` to bind parameter UBOs

Pull Request resolved: #3150

## Context

In keeping with the below changeset in this stack, this diff introduces the `ParamsBindList` structure to avoid storing shared pointers to `api::UniformParamsBuffer` objects in `ExecuteNode` and `PrepackNode`.

The idea is to store the binding information of each UPB instead of taking ownership of the UPB itself. There isn't really a need for `ExecuteNode` and `PrepackNode` to take ownership since `ComputeGraph` provides a guarantee that the UPBs will be in scope at the time of binding.

With this change, all `shared_ptr` members can be eliminated from `vTensor`, further reducing heap allocations and pointer chasing.

In the future I will change `prepack_nodes_` and `execute_nodes_` to store `PrepackNode` and `ExecuteNode` instances directly instead of storing unique pointers to them.


ghstack-source-id: 223225899
@exported-using-ghexport

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

This pull request has been merged in db17853.

@mergennachin mergennachin mentioned this pull request Apr 26, 2024
@SS-JIA SS-JIA deleted the gh/SS-JIA/41/head branch January 24, 2025 19:39
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 Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants