-
Notifications
You must be signed in to change notification settings - Fork 185
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
Introduce lowbit quantized linear MPS kernels #954
Introduce lowbit quantized linear MPS kernels #954
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/954
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 6661971 with merge base 0f6bae5 (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This pull request was exported from Phabricator. Differential Revision: D63342895 |
Summary: The following is the directory structure of the submitted code under torchao ``` experimental/ ├── kernels/ │ └── mps/ │ ├── metal/ │ │ └── (metal shaders) │ ├── src/ │ │ └── (tensor agnostic mps kernel implementations) │ └── test/ │ │ └── (directly test mps kernel implementations) └── ops/ └── mps/ ├── register.mm ├── setup.py └── test/ └── (test torch custom ops) ``` Differential Revision: D63342895
9ad395e
to
e06802b
Compare
This pull request was exported from Phabricator. Differential Revision: D63342895 |
Summary: The following is the directory structure of the submitted code under torchao ``` experimental/ ├── kernels/ │ └── mps/ │ ├── metal/ │ │ └── (metal shaders) │ ├── src/ │ │ └── (tensor agnostic mps kernel implementations) │ └── test/ │ │ └── (directly test mps kernel implementations) └── ops/ └── mps/ ├── register.mm ├── setup.py └── test/ └── (test torch custom ops) ``` Differential Revision: D63342895
e06802b
to
e783565
Compare
This pull request was exported from Phabricator. Differential Revision: D63342895 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left quite a few comments. Lets address those. At high level
- Figure out plan to how we gonna read .metal file. Likely similar to what torch does but see what MLX does too
- Better test cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left quite a few comments. Lets address those. At high level
- Figure out plan to how we gonna read .metal file. Likely similar to what torch does but see what MLX does too
- Better test cases
e783565
to
b4943fe
Compare
Summary: The following is the directory structure of the submitted code under torchao ``` experimental/ ├── kernels/ │ └── mps/ │ ├── metal/ │ │ └── (metal shaders) │ ├── src/ │ │ └── (tensor agnostic mps kernel implementations) │ └── test/ │ │ └── (directly test mps kernel implementations) └── ops/ └── mps/ ├── register.mm ├── setup.py └── test/ └── (test torch custom ops) ``` Differential Revision: D63342895
This pull request was exported from Phabricator. Differential Revision: D63342895 |
Summary: The following is the directory structure of the submitted code under torchao ``` experimental/ ├── kernels/ │ └── mps/ │ ├── metal/ │ │ └── (metal shaders) │ ├── src/ │ │ └── (tensor agnostic mps kernel implementations) │ └── test/ │ │ └── (directly test mps kernel implementations) └── ops/ └── mps/ ├── register.mm ├── setup.py └── test/ └── (test torch custom ops) ``` Differential Revision: D63342895
b4943fe
to
6c16c82
Compare
This pull request was exported from Phabricator. Differential Revision: D63342895 |
const std::string& source) { | ||
NSError* error = nil; | ||
MTLCompileOptions* options = [MTLCompileOptions new]; | ||
[options setLanguageVersion:MTLLanguageVersion3_1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably want to disable fast math here as well...
ext_modules=[ | ||
CppExtension( | ||
name="torchao_mps_ops", | ||
sources=["register.mm"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you either need to package your kernels into the wheel, or using bin2c
just convert them to headers. Or convert them into a metallib
Summary: The following is the directory structure of the submitted code under torchao ``` experimental/ ├── kernels/ │ └── mps/ │ ├── codegen/ │ │ └── gen_metal_shader_lib.py │ ├── metal/ │ │ └── (metal shaders) │ ├── src/ │ │ └── (tensor agnostic mps kernel implementations) │ ├── test/ │ │ └── (directly test mps kernel implementations) │ └── metal.yaml └── ops/ └── mps/ ├── register.mm ├── setup.py └── test/ └── (test torch custom ops) ``` Reviewed By: malfet Differential Revision: D63342895
6c16c82
to
730561d
Compare
This pull request was exported from Phabricator. Differential Revision: D63342895 |
Summary: The following is the directory structure of the submitted code under torchao ``` experimental/ ├── kernels/ │ └── mps/ │ ├── codegen/ │ │ └── gen_metal_shader_lib.py │ ├── metal/ │ │ └── (metal shaders) │ ├── src/ │ │ └── (tensor agnostic mps kernel implementations) │ ├── test/ │ │ └── (directly test mps kernel implementations) │ └── metal.yaml └── ops/ └── mps/ ├── register.mm ├── setup.py └── test/ └── (test torch custom ops) ``` Reviewed By: malfet Differential Revision: D63342895
730561d
to
6661971
Compare
This pull request was exported from Phabricator. Differential Revision: D63342895 |
Differential Revision: D63342895 Pull Request resolved: #954
Summary:
The following is the directory structure of the submitted code under torchao
Differential Revision: D63342895