Skip to content

[MPS] Add version check#78192

Closed
malfet wants to merge 1 commit intomasterfrom
malfet/mps-add-version-check
Closed

[MPS] Add version check#78192
malfet wants to merge 1 commit intomasterfrom
malfet/mps-add-version-check

Conversation

@malfet
Copy link
Contributor

@malfet malfet commented May 24, 2022

Use instancesRespondToSelector: to test the presence of
optimizationLevel in MPSGraphCompilationDescriptor, which according
to
https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphcompilationdescriptor/3922624-optimizationlevel
is only available on 12.3 or newer

This works around a limitations of @available(macOS 12.3, *) macro in
shared libraries dynamically loaded by apps targeting older runtime.
And deployment target for macos Python conda binaries is 10.14:

% otool -l `which python3`
...
Load command 9
      cmd LC_BUILD_VERSION
  cmdsize 32
 platform 1
    minos 10.14
      sdk 10.14
...

Use `instancesRespondToSelector:` to test the presence of
`optimizationLevel` in `MPSGraphCompilationDescriptor`, which according
to
https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphcompilationdescriptor/3922624-optimizationlevel
is only available on 12.3 or newer

This works around a limitations of `@available(macOS 12.3, *)` macro in
shared libraries dynamically loaded by apps targeting older runtime.
And deployment target for macos Python conda binaries is 10.14:
```
% otool -l `which python3`
...
Load command 9
      cmd LC_BUILD_VERSION
  cmdsize 32
 platform 1
    minos 10.14
      sdk 10.14
...
```
@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented May 24, 2022

🔗 Helpful links

✅ No Failures (18 Pending)

As of commit 48fd2d7 (more details on the Dr. CI page):

Expand to see more

💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@malfet malfet requested a review from albanD May 24, 2022 18:45
@malfet malfet added the module: mps Related to Apple Metal Performance Shaders framework label May 24, 2022
@malfet malfet added this to the 1.12.0 milestone May 24, 2022
Copy link
Contributor

@atalman atalman left a comment

Choose a reason for hiding this comment

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

LGTM

@malfet malfet added the ciflow/trunk Trigger trunk jobs on your pull request label May 24, 2022
@malfet
Copy link
Contributor Author

malfet commented May 24, 2022

@pytorchbot merge this

@pytorchmergebot
Copy link
Collaborator

Merge failed due to Refusing to merge as mandatory check(s)linux-docs / build-docs (cpp) failed for rule superuser
Raised by https://github.com/pytorch/pytorch/actions/runs/2380932375

@malfet
Copy link
Contributor Author

malfet commented May 24, 2022

@pytorchbot force merge this as windows failures exists on trunk

@github-actions
Copy link
Contributor

Hey @malfet.
You've committed this PR, but it does not have both a 'release notes: ...' and 'topics: ...' label. Please add one of each to the PR. The 'release notes: ...' label should represent the part of PyTorch that this PR changes (fx, autograd, distributed, etc) and the 'topics: ...' label should represent the kind of PR it is (not user facing, new feature, bug fix, perf improvement, etc). The list of valid labels can be found here for the 'release notes: ...' and here for the 'topics: ...'.
For changes that are 'topic: not user facing' there is no need for a release notes label.

facebook-github-bot pushed a commit that referenced this pull request May 26, 2022
Summary:
Use `instancesRespondToSelector:` to test the presence of
`optimizationLevel` in `MPSGraphCompilationDescriptor`, which according
to
https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphcompilationdescriptor/3922624-optimizationlevel
is only available on 12.3 or newer

This works around a limitations of `available(macOS 12.3, *)` macro in
shared libraries dynamically loaded by apps targeting older runtime.
And deployment target for macos Python conda binaries is 10.14:
```
% otool -l `which python3`
...
Load command 9
      cmd LC_BUILD_VERSION
  cmdsize 32
 platform 1
    minos 10.14
      sdk 10.14
...
```

Pull Request resolved: #78192
Approved by: https://github.com/atalman, https://github.com/seemethere

Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/b7bb34d7625d95e5088638721dcc07c2bc5e2ade

Reviewed By: mehtanirav

Differential Revision: D36668764

Pulled By: malfet

fbshipit-source-id: fa4d03a15ea19159a039526e68b2c28722b75493
atalman pushed a commit to atalman/pytorch that referenced this pull request Jun 6, 2022
Use `instancesRespondToSelector:` to test the presence of
`optimizationLevel` in `MPSGraphCompilationDescriptor`, which according
to
https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphcompilationdescriptor/3922624-optimizationlevel
is only available on 12.3 or newer

This works around a limitations of `@available(macOS 12.3, *)` macro in
shared libraries dynamically loaded by apps targeting older runtime.
And deployment target for macos Python conda binaries is 10.14:
```
% otool -l `which python3`
...
Load command 9
      cmd LC_BUILD_VERSION
  cmdsize 32
 platform 1
    minos 10.14
      sdk 10.14
...
```

Pull Request resolved: pytorch#78192
Approved by: https://github.com/atalman, https://github.com/seemethere
malfet added a commit that referenced this pull request Jun 7, 2022
Use `instancesRespondToSelector:` to test the presence of
`optimizationLevel` in `MPSGraphCompilationDescriptor`, which according
to
https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphcompilationdescriptor/3922624-optimizationlevel
is only available on 12.3 or newer

This works around a limitations of `@available(macOS 12.3, *)` macro in
shared libraries dynamically loaded by apps targeting older runtime.
And deployment target for macos Python conda binaries is 10.14:
```
% otool -l `which python3`
...
Load command 9
      cmd LC_BUILD_VERSION
  cmdsize 32
 platform 1
    minos 10.14
      sdk 10.14
...
```

Pull Request resolved: #78192
Approved by: https://github.com/atalman, https://github.com/seemethere

(cherry picked from commit b7bb34d)
@malfet malfet deleted the malfet/mps-add-version-check branch July 17, 2022 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request cla signed Merged module: mps Related to Apple Metal Performance Shaders framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants