Enable building for metal with macOS SDK < 15#17435
Enable building for metal with macOS SDK < 15#17435mattjcly wants to merge 2 commits intopytorch:mainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/17435
Note: Links to docs will display an error until the docs builds have been completed.
|
This PR needs a
|
|
Only failing test that seems potentially relevant is pull / unittest-editable / macos / macos-job ... will try to understand exactly what this is testing and if this is a true failure/breakage or not |
|
@mattjcly Let me rerun the failing test again. It might some tolerance issue |
|
One more example where we could have shared code better between PT and ET, as we've solved this problem a while back :) |
There was a problem hiding this comment.
IMO it'll be better to do it other way around:
define new enums if you compiling with the older SDK, and then indeed rely on @available...
See https://github.com/pytorch/pytorch/blob/4504c3dcee3c02886fae3340a8ee268717c6cb32/aten/src/ATen/native/mps/MPSGraphSequoiaOps.h as an example of accomplishing that
| #include <optional> | ||
| #include <exception> | ||
|
|
||
| #if (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 150000) || \ |
There was a problem hiding this comment.
IMO this is wrong, because it will require one to have two binaries, one for older and another one for newer SDK
Very smart! Thanks for taking a look. Just made the change and re-confirmed can still build and run parakeet metal on both SDK 14.2 and 26.1 |
Summary
Fixes compilation errors on macOS w/ SDK < 15 due to non-existent properties:
Keep runtime check
Test plan
Confirmed working build on machine with:
That did not work before.
Also confirmed to still work on 26.1:
Including verification that inside of if/else def was triggered with a
#warning(since removed) to see:Confirmed Parakeet inference to still work on both machines.