-
Notifications
You must be signed in to change notification settings - Fork 177
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
cmake torchao_ops_mps_linear_fp_act_xbit_weight #1304
cmake torchao_ops_mps_linear_fp_act_xbit_weight #1304
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/1304
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ No FailuresAs of commit a388689 with merge base ca52cdc (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This pull request was exported from Phabricator. Differential Revision: D66120124 |
target_compile_definitions(torchao_ops_mps_linear_fp_act_xbit_weight_aten PRIVATE USE_ATEN=1) | ||
|
||
# Enable Metal support | ||
if (APPLE) |
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.
Do we need to gate from specific version of OS? I think we should. both iOS and MacOS
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.
mostly nits, but one question on file removal
-B ${CMAKE_OUT} | ||
cmake --build ${CMAKE_OUT} -j 16 --target install --config Release | ||
|
||
rm ../../kernels/mps/src/metal_shader_lib.h |
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.
wait what is this?
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.
after I am done building and installing, I don't need the generated metal_shader_lib.h anymore.
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.
ok then generated artifacts should be stored in build directory as temporary artifacts or somewhere else. Adding in the repo folder and removing it can leave the repo in dirty state if build fails. Also generally clean
|
||
python ../../kernels/mps/codegen/gen_metal_shader_lib.py | ||
|
||
export CMAKE_PREFIX_PATH=$(python -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())') |
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.
why cmake prefix path points to site-packages?
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.
that's where the cmake stuff is. I am working on a conda environment.
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.
what do you mean thats where the cmake stuff is. prefix path is used for looking up packages https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html and other stuff
path_libtorchao_ops_mps_aten = os.path.abspath( | ||
os.path.join( | ||
os.path.dirname(__file__), "../cmake-out/lib/libtorchao_ops_mps_linear_fp_act_xbit_weight_aten.dylib" | ||
) | ||
) | ||
torch.ops.load_library(path_libtorchao_ops_mps_aten) |
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.
- If and when we integrate experimental with torchao's pip installation, like pip install . or setup then at that type this lib should be installed in site-packages or some place like that instead of making it available via cmake-out in this way
- Put it under try catch and throw error message if not found
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.
mostly nits, but one question on file removal
This pull request was exported from Phabricator. Differential Revision: D66120124 |
Summary: Pull Request resolved: pytorch#1304 Move from setup.py to cmake for building custom torchao mps ops Differential Revision: D66120124
9e2bda1
to
3f7ef3b
Compare
This pull request was exported from Phabricator. Differential Revision: D66120124 |
Summary: Pull Request resolved: pytorch#1304 Move from setup.py to cmake for building custom torchao mps ops Differential Revision: D66120124
3f7ef3b
to
20a5673
Compare
This pull request was exported from Phabricator. Differential Revision: D66120124 |
Summary: Pull Request resolved: pytorch#1304 Move from setup.py to cmake for building custom torchao mps ops Differential Revision: D66120124
20a5673
to
a3bb86d
Compare
a3bb86d
to
249a823
Compare
Summary: Pull Request resolved: pytorch#1304 Move from setup.py to cmake for building custom torchao mps ops Differential Revision: D66120124
This pull request was exported from Phabricator. Differential Revision: D66120124 |
Summary: Pull Request resolved: pytorch#1304 Move from setup.py to cmake for building custom torchao mps ops Differential Revision: D66120124
249a823
to
efea60e
Compare
This pull request was exported from Phabricator. Differential Revision: D66120124 |
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.
Stamping for now. Do consider addressing comments before landing
This pull request was exported from Phabricator. Differential Revision: D66120124 |
Summary: Pull Request resolved: pytorch#1304 Move from setup.py to cmake for building custom torchao mps ops Differential Revision: D66120124
efea60e
to
a6c04fa
Compare
This pull request was exported from Phabricator. Differential Revision: D66120124 |
Summary: Pull Request resolved: pytorch#1304 Move from setup.py to cmake for building custom torchao mps ops Differential Revision: D66120124
a6c04fa
to
4aa2983
Compare
Summary: Pull Request resolved: pytorch#1304 Move from setup.py to cmake for building custom torchao mps ops Differential Revision: D66120124
4aa2983
to
560f37a
Compare
This pull request was exported from Phabricator. Differential Revision: D66120124 |
1 similar comment
This pull request was exported from Phabricator. Differential Revision: D66120124 |
Summary: Pull Request resolved: pytorch#1304 Move from setup.py to cmake for building custom torchao mps ops Reviewed By: kimishpatel Differential Revision: D66120124
560f37a
to
32fc0e7
Compare
Summary: Pull Request resolved: pytorch#1304 Move from setup.py to cmake for building custom torchao mps ops Reviewed By: kimishpatel Differential Revision: D66120124
32fc0e7
to
a388689
Compare
This pull request was exported from Phabricator. Differential Revision: D66120124 |
Summary: Move from setup.py to cmake for building custom torchao mps ops
Differential Revision: D66120124