<pre style='margin:0'>
Christopher Nielsen (mascguy) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/217f82b3d74997385429448e06addc1322d09fb3">https://github.com/macports/macports-ports/commit/217f82b3d74997385429448e06addc1322d09fb3</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 217f82b3d74 py-pytorch: mps: only enable for 10.13 and later - Also disable compilation error bitwise-instead-of-logical See: https://trac.macports.org/ticket/65682
</span>217f82b3d74 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 217f82b3d74997385429448e06addc1322d09fb3
</span>Author: Christopher Nielsen <mascguy@github.com>
AuthorDate: Thu Aug 25 10:15:48 2022 -0400
<span style='display:block; white-space:pre;color:#404040;'> py-pytorch: mps: only enable for 10.13 and later
</span><span style='display:block; white-space:pre;color:#404040;'> - Also disable compilation error bitwise-instead-of-logical
</span><span style='display:block; white-space:pre;color:#404040;'> See: https://trac.macports.org/ticket/65682
</span>---
python/py-pytorch/Portfile | 40 ++++++++++++++++++++++++----------------
1 file changed, 24 insertions(+), 16 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/python/py-pytorch/Portfile b/python/py-pytorch/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 79e9f1a17b9..73f5de94852 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/python/py-pytorch/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/python/py-pytorch/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -49,17 +49,28 @@ if {${os.arch} in [list i386]} {
</span> default_variants-append +mkl
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-variant mps description {Enable Apple Metal Performance Shaders (MPS) support} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- use_xcode yes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+platform darwin {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${os.major} <= 15} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ known_fail yes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ pre-fetch {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error "$subport is not supported on OS X 10.11 and older."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return -code error "unsupported platform"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>- build.env-append \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- APPLE=ON \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- USE_MPS=ON \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- USE_PYTORCH_METAL=ON \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- USE_PYTORCH_METAL_EXPORT=ON
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # MPS support added in 10.13
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${os.major} >= 17} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ variant mps description {Enable Apple Metal Performance Shaders (MPS) support} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ use_xcode yes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ build.env-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ APPLE=ON \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ USE_MPS=ON \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ USE_PYTORCH_METAL=ON \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ USE_PYTORCH_METAL_EXPORT=ON
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>- notes-append \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ notes-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+"
</span> The port ${subport} is built with Apple Metal Performance Shaders (MPS)\
support for GPU hardware acceleration. To enable Apple GPU devices,\
use device \"mps\". Matrix multiplication example:
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -71,14 +82,9 @@ use device \"mps\". Matrix multiplication example:
</span> x = torch.randn((10_000, 1_000), device=mpsDevice)
cov = (x.T @ x)/x.shape\[0]
"
<span style='display:block; white-space:pre;background:#ffe0e0;'>-}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-default_variants-append +mps
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>-if {${os.platform} eq "darwin" && ${os.major} <= 15} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- known_fail yes
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- pre-fetch {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_error "$subport is not supported on OS X 10.11 and older."
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return -code error "unsupported platform"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ default_variants-append +mps
</span> }
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -152,6 +158,8 @@ if {${name} ne ${subport}} {
</span> }
configure.ccache yes
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.cxxflags-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -Wno-bitwise-instead-of-logical
</span>
# ZSTD support broke with 1.2.0-1.12.0. Check with future releases.
build.env-append \
</pre><pre style='margin:0'>
</pre>