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

[ET-VK] Organize utils #2323

Closed
wants to merge 1 commit into from

Conversation

jorgep31415
Copy link
Contributor

@jorgep31415 jorgep31415 commented Mar 8, 2024

Stack from ghstack (oldest at bottom):

Refactor our OpUtils.*, StagingUtils.*, and Utils.* which have accumulated helper functions during the redesign.

We split them and move them into two new folders:

  1. ops/utils: Used by files in ops/ and ops/impl/.
  2. ops/impl/utils: Used only by files in ops/impl/.

In general, this helps to unflatten the ops/ directory:

[jorgep31415@devvm15882.vll0 /data/users/jorgep31415/fbsource/xplat/executorch/backends/vulkan/runtime/graph/ops (98b0e789c)]$ tree
.
├── ExecuteNode.cpp
├── ExecuteNode.h
├── impl
│   ├── Arithmetic.cpp
│   ├── Arithmetic.h
│   ├── Staging.cpp
│   ├── Staging.h
│   └── utils
│       ├── DimUtils.h
│       ├── ScalarUtils.h
│       ├── TensorUtils.cpp
│       └── TensorUtils.h
├── OperatorRegistry.cpp
├── OperatorRegistry.h
├── PrepackNode.cpp
├── PrepackNode.h
└── utils
    ├── BindingUtils.cpp
    ├── BindingUtils.h
    ├── StagingUtils.cpp
    └── StagingUtils.h

3 directories, 18 files

Since we're heavily updating include declarations, we also introduce the convention to only include the VK-API via

#include <ATen/native/vulkan/api/api.h>

instead of including more specific files, e.g.,

#include <ATen/native/vulkan/api/Tensor.h>

Differential Revision: D54690346

Refactor our `OpUtils.*`, `StagingUtils.*`, and `Utils.*` which have accumulated helper functions during the redesign.

We split them and move them into two new folders:
1. `ops/utils`:  Used by files in `ops/` and `ops/impl/`.
2. `ops/impl/utils`:  Used only by files in `ops/impl/`.

In general, this helps to unflatten the `ops/` directory:
```
[jorgep31415@devvm15882.vll0 /data/users/jorgep31415/fbsource/xplat/executorch/backends/vulkan/runtime/graph/ops (98b0e789c)]$ tree
.
├── ExecuteNode.cpp
├── ExecuteNode.h
├── impl
│   ├── Arithmetic.cpp
│   ├── Arithmetic.h
│   ├── Staging.cpp
│   ├── Staging.h
│   └── utils
│       ├── DimUtils.h
│       ├── ScalarUtils.h
│       ├── TensorUtils.cpp
│       └── TensorUtils.h
├── OperatorRegistry.cpp
├── OperatorRegistry.h
├── PrepackNode.cpp
├── PrepackNode.h
└── utils
    ├── BindingUtils.cpp
    ├── BindingUtils.h
    ├── StagingUtils.cpp
    └── StagingUtils.h

3 directories, 18 files
```

Since we're heavily updating include declarations, we also introduce the convention to only include the VK-API via
```
#include <ATen/native/vulkan/api/api.h>
```
instead of including more specific files, e.g.,
```
#include <ATen/native/vulkan/api/Tensor.h>
```

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

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Mar 8, 2024

🔗 Helpful Links

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

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

❌ 2 New Failures

As of commit 2a96ea8 with merge base 0b6add8 (image):

NEW FAILURES - The following jobs have failed:

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 Mar 8, 2024
@facebook-github-bot
Copy link
Contributor

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

jorgep31415 added a commit that referenced this pull request Mar 8, 2024
Refactor our `OpUtils.*`, `StagingUtils.*`, and `Utils.*` which have accumulated helper functions during the redesign.

We split them and move them into two new folders:
1. `ops/utils`:  Used by files in `ops/` and `ops/impl/`.
2. `ops/impl/utils`:  Used only by files in `ops/impl/`.

In general, this helps to unflatten the `ops/` directory:
```
[jorgep31415devvm15882.vll0 /data/users/jorgep31415/fbsource/xplat/executorch/backends/vulkan/runtime/graph/ops (98b0e789c)]$ tree
.
├── ExecuteNode.cpp
├── ExecuteNode.h
├── impl
│   ├── Arithmetic.cpp
│   ├── Arithmetic.h
│   ├── Staging.cpp
│   ├── Staging.h
│   └── utils
│       ├── DimUtils.h
│       ├── ScalarUtils.h
│       ├── TensorUtils.cpp
│       └── TensorUtils.h
├── OperatorRegistry.cpp
├── OperatorRegistry.h
├── PrepackNode.cpp
├── PrepackNode.h
└── utils
    ├── BindingUtils.cpp
    ├── BindingUtils.h
    ├── StagingUtils.cpp
    └── StagingUtils.h

3 directories, 18 files
```

Since we're heavily updating include declarations, we also introduce the convention to only include the VK-API via
```
#include <ATen/native/vulkan/api/api.h>
```
instead of including more specific files, e.g.,
```
#include <ATen/native/vulkan/api/Tensor.h>
```

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

ghstack-source-id: 217990425
Pull Request resolved: #2323
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in ac8267b.

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