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

Create header for packed weight ops #1072

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

metascroy
Copy link
Contributor

Summary:
This diff defines a packed_weight hader in torchao/experimental/ops/packed_weights_header.h.

The header is 16 bytes and has 4 fields:

  • format: PackedWeightsFormat (enum)
  • extra0: int
  • extra1: int
  • extra2: int

Whenever we have a new format type, we can add a field to the enum. Currently I have a field for the format the universal kernels use, but MPS can have a different format, and KleidiAI also has its own format.

I modified the pack ops put this header and the start of the packed weights. When the linear op runs, it reads the header to understand how the weights were packed.

Reviewed By: digantdesai

Differential Revision: D63498956

Copy link

pytorch-bot bot commented Oct 14, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/1072

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

✅ No Failures

As of commit 452b52b with merge base afc0a02 (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 Oct 14, 2024
@facebook-github-bot
Copy link

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

@digantdesai
Copy link
Contributor

Couple of things

  • update the summary
  • add a test to ensure we don't break BC accidently

metascroy added a commit to metascroy/ao that referenced this pull request Oct 15, 2024
Summary:

This diff defines a packed_weight hader in torchao/experimental/ops/packed_weights_header.h.

The header is 16 bytes and has 4 fields:
* format: PackedWeightsFormat (enum)
* extra0: int
* extra1: int
* extra2: int

Whenever we have a new format type, we can add a field to the enum.  Currently I have a field for the format the universal kernels use, but MPS can have a different format, and KleidiAI also has its own format.

I modified the pack ops put this header and the start of the packed weights.  When the linear op runs, it reads the header to understand how the weights were packed.

Reviewed By: digantdesai

Differential Revision: D63498956
@facebook-github-bot
Copy link

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

Summary:

This diff defines a packed_weight hader in torchao/experimental/ops/packed_weights_header.h.

The header is 16 bytes and has 4 fields:
* format: PackedWeightsFormat (enum)
* extra0: int
* extra1: int
* extra2: int

Whenever we have a new format type, we can add a field to the enum.  Currently I have a field for the format the universal kernels use, but MPS can have a different format, and KleidiAI also has its own format.

I modified the pack ops put this header and the start of the packed weights.  When the linear op runs, it reads the header to understand how the weights were packed.

Reviewed By: digantdesai

Differential Revision: D63498956
@facebook-github-bot
Copy link

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

@facebook-github-bot facebook-github-bot merged commit ff65188 into pytorch:main Oct 15, 2024
17 of 19 checks passed
jainapurva pushed a commit that referenced this pull request Oct 15, 2024
Differential Revision: D63498956

Pull Request resolved: #1072
yanbing-j pushed a commit to yanbing-j/ao that referenced this pull request Dec 9, 2024
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