Skip to content

Add wrapper code to wrap an ET kernel into an ATen kernel#2186

Closed
larryliu0820 wants to merge 16 commits intogh/larryliu0820/20/basefrom
gh/larryliu0820/20/head
Closed

Add wrapper code to wrap an ET kernel into an ATen kernel#2186
larryliu0820 wants to merge 16 commits intogh/larryliu0820/20/basefrom
gh/larryliu0820/20/head

Conversation

@larryliu0820
Copy link
Contributor

@larryliu0820 larryliu0820 commented Feb 29, 2024

Stack from ghstack (oldest at bottom):

Summary:

Add an API that is able to wrap ExecuTorch kernels into ATen kernels.

This can save kernel author time, if they start from ExecuTorch kernels.

In this PR we only support the following argument types to ExecuTorch
kernels:

  • Tensor-like. torch::executor::Tensor and its reference/const
    reference.
  • Primitive types. int float etc.

Doesn't support ArrayRef or Optional yet.

Test Plan:

Rely on unit tests

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: D54394149

Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Feb 29, 2024

🔗 Helpful Links

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

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

❌ 1 New Failure

As of commit d12ab2c with merge base e2b733e (image):

NEW FAILURE - The following job has failed:

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

larryliu0820 added a commit that referenced this pull request Feb 29, 2024
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: d1ed8a7
Pull Request resolved: #2186
@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 Feb 29, 2024
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Feb 29, 2024
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: ccd02df
Pull Request resolved: #2186
larryliu0820 added a commit that referenced this pull request Feb 29, 2024
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: ccd02df
Pull Request resolved: #2186
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Feb 29, 2024
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: ff14d06
Pull Request resolved: #2186
@larryliu0820
Copy link
Contributor Author

@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Feb 29, 2024
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 330fb65
Pull Request resolved: #2186
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Mar 1, 2024
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: a3bb696
Pull Request resolved: #2186
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Mar 1, 2024
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: b01af59
Pull Request resolved: #2186
Copy link
Contributor

@iseeyuan iseeyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What types are mapped from ExecuTorch to ATen? Does it works for tensors, list and prim types? Please add what can be mapped and what cannot be mapped.

larryliu0820 added a commit that referenced this pull request Mar 7, 2024
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: b01af59
Pull Request resolved: #2186
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Mar 12, 2024
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: c8ff3be
Pull Request resolved: #2186
@larryliu0820
Copy link
Contributor Author

@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Summary:

Add an API that is able to wrap ExecuTorch kernels into ATen kernels.

This can save kernel author time, if they start from ExecuTorch kernels.

Test Plan:

Rely on unit tests
Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Mar 12, 2024
Summary:

Add an API that is able to wrap ExecuTorch kernels into ATen kernels.

This can save kernel author time, if they start from ExecuTorch kernels.

In this PR we only support the following argument types to ExecuTorch
kernels:

* Tensor-like. `torch::executor::Tensor` and its reference/const
  reference.
* Primitive types. `int` `float` etc.

Doesn't support ArrayRef or Optional yet.

Test Plan:

Rely on unit tests

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 08efcb4
Pull Request resolved: #2186
@larryliu0820
Copy link
Contributor Author

@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Summary:

Add an API that is able to wrap ExecuTorch kernels into ATen kernels.

This can save kernel author time, if they start from ExecuTorch kernels.

In this PR we only support the following argument types to ExecuTorch
kernels:

* Tensor-like. `torch::executor::Tensor` and its reference/const
  reference.
* Primitive types. `int` `float` etc.

Doesn't support ArrayRef or Optional yet.

Test Plan:

Rely on unit tests

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Mar 12, 2024
Summary:

Add an API that is able to wrap ExecuTorch kernels into ATen kernels.

This can save kernel author time, if they start from ExecuTorch kernels.

In this PR we only support the following argument types to ExecuTorch
kernels:

* Tensor-like. `torch::executor::Tensor` and its reference/const
  reference.
* Primitive types. `int` `float` etc.

Doesn't support ArrayRef or Optional yet.

Test Plan:

Rely on unit tests

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: ce0cc7a
Pull Request resolved: #2186
@larryliu0820
Copy link
Contributor Author

@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Summary:

Add an API that is able to wrap ExecuTorch kernels into ATen kernels.

This can save kernel author time, if they start from ExecuTorch kernels.

In this PR we only support the following argument types to ExecuTorch
kernels:

* Tensor-like. `torch::executor::Tensor` and its reference/const
  reference.
* Primitive types. `int` `float` etc.

Doesn't support ArrayRef or Optional yet.

Test Plan:

Rely on unit tests

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Mar 12, 2024
Summary:

Add an API that is able to wrap ExecuTorch kernels into ATen kernels.

This can save kernel author time, if they start from ExecuTorch kernels.

In this PR we only support the following argument types to ExecuTorch
kernels:

* Tensor-like. `torch::executor::Tensor` and its reference/const
  reference.
* Primitive types. `int` `float` etc.

Doesn't support ArrayRef or Optional yet.

Test Plan:

Rely on unit tests

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: e0da0f0
Pull Request resolved: #2186
@larryliu0820
Copy link
Contributor Author

@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Summary:

Add an API that is able to wrap ExecuTorch kernels into ATen kernels.

This can save kernel author time, if they start from ExecuTorch kernels.

In this PR we only support the following argument types to ExecuTorch
kernels:

* Tensor-like. `torch::executor::Tensor` and its reference/const
  reference.
* Primitive types. `int` `float` etc.

Doesn't support ArrayRef or Optional yet.

Test Plan:

Rely on unit tests

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Mar 12, 2024
Summary:

Add an API that is able to wrap ExecuTorch kernels into ATen kernels.

This can save kernel author time, if they start from ExecuTorch kernels.

In this PR we only support the following argument types to ExecuTorch
kernels:

* Tensor-like. `torch::executor::Tensor` and its reference/const
  reference.
* Primitive types. `int` `float` etc.

Doesn't support ArrayRef or Optional yet.

Test Plan:

Rely on unit tests

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: cf5ce9f
Pull Request resolved: #2186
@larryliu0820
Copy link
Contributor Author

@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Summary:

Add an API that is able to wrap ExecuTorch kernels into ATen kernels.

This can save kernel author time, if they start from ExecuTorch kernels.

In this PR we only support the following argument types to ExecuTorch
kernels:

* Tensor-like. `torch::executor::Tensor` and its reference/const
  reference.
* Primitive types. `int` `float` etc.

Doesn't support ArrayRef or Optional yet.

Test Plan:

Rely on unit tests

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
@larryliu0820
Copy link
Contributor Author

@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Summary:

Add an API that is able to wrap ExecuTorch kernels into ATen kernels.

This can save kernel author time, if they start from ExecuTorch kernels.

In this PR we only support the following argument types to ExecuTorch
kernels:

* Tensor-like. `torch::executor::Tensor` and its reference/const
  reference.
* Primitive types. `int` `float` etc.

Doesn't support ArrayRef or Optional yet.

Test Plan:

Rely on unit tests

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
@larryliu0820
Copy link
Contributor Author

@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@larryliu0820
Copy link
Contributor Author

@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Summary:

Add an API that is able to wrap ExecuTorch kernels into ATen kernels.

This can save kernel author time, if they start from ExecuTorch kernels.

In this PR we only support the following argument types to ExecuTorch
kernels:

* Tensor-like. `torch::executor::Tensor` and its reference/const
  reference.
* Primitive types. `int` `float` etc.

Doesn't support ArrayRef or Optional yet.

Test Plan:

Rely on unit tests

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
@larryliu0820
Copy link
Contributor Author

@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

larryliu0820 added a commit that referenced this pull request Mar 13, 2024
Summary:

Add an API that is able to wrap ExecuTorch kernels into ATen kernels.

This can save kernel author time, if they start from ExecuTorch kernels.

In this PR we only support the following argument types to ExecuTorch
kernels:

* Tensor-like. `torch::executor::Tensor` and its reference/const
  reference.
* Primitive types. `int` `float` etc.

Doesn't support ArrayRef or Optional yet.

Test Plan:

Rely on unit tests

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 2ac8c4c
Pull Request resolved: #2186
larryliu0820 added a commit that referenced this pull request Mar 13, 2024
Summary:

Add an API that is able to wrap ExecuTorch kernels into ATen kernels.

This can save kernel author time, if they start from ExecuTorch kernels.

In this PR we only support the following argument types to ExecuTorch
kernels:

* Tensor-like. `torch::executor::Tensor` and its reference/const
  reference.
* Primitive types. `int` `float` etc.

Doesn't support ArrayRef or Optional yet.

Test Plan:

Rely on unit tests

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: e8b0c10
Pull Request resolved: #2186
Summary:

Add an API that is able to wrap ExecuTorch kernels into ATen kernels.

This can save kernel author time, if they start from ExecuTorch kernels.

In this PR we only support the following argument types to ExecuTorch
kernels:

* Tensor-like. `torch::executor::Tensor` and its reference/const
  reference.
* Primitive types. `int` `float` etc.

Doesn't support ArrayRef or Optional yet.

Test Plan:

Rely on unit tests

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Mar 13, 2024
Summary:

Add an API that is able to wrap ExecuTorch kernels into ATen kernels.

This can save kernel author time, if they start from ExecuTorch kernels.

In this PR we only support the following argument types to ExecuTorch
kernels:

* Tensor-like. `torch::executor::Tensor` and its reference/const
  reference.
* Primitive types. `int` `float` etc.

Doesn't support ArrayRef or Optional yet.

Test Plan:

Rely on unit tests

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 45d661f
Pull Request resolved: #2186
@larryliu0820
Copy link
Contributor Author

@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Summary:

Add an API that is able to wrap ExecuTorch kernels into ATen kernels.

This can save kernel author time, if they start from ExecuTorch kernels.

In this PR we only support the following argument types to ExecuTorch
kernels:

* Tensor-like. `torch::executor::Tensor` and its reference/const
  reference.
* Primitive types. `int` `float` etc.

Doesn't support ArrayRef or Optional yet.

Test Plan:

Rely on unit tests

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
larryliu0820 added a commit that referenced this pull request Mar 13, 2024
Summary:

Add an API that is able to wrap ExecuTorch kernels into ATen kernels.

This can save kernel author time, if they start from ExecuTorch kernels.

In this PR we only support the following argument types to ExecuTorch
kernels:

* Tensor-like. `torch::executor::Tensor` and its reference/const
  reference.
* Primitive types. `int` `float` etc.

Doesn't support ArrayRef or Optional yet.

Test Plan:

Rely on unit tests

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 16d551a
Pull Request resolved: #2186
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 20f5073.

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. Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants