Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#65682 closed defect (fixed)

py-pytorch: variant +mps causes build failures for 10.12 and 10.13

Reported by: mascguy (Christopher Nielsen) Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: Cc: essandess (Steve Smith)
Port: py-pytorch

Description

The latest update to this port added support for Metal Performance Shaders, via variant +mps. And that's enabled by default.

However, builds are now failing on 10.12 and 10.13, with the following compilation error:

[  0%] Building CXX object third_party/fbgemm/asmjit/CMakeFiles/asmjit.dir/src/asmjit/core/archtraits.cpp.o
In file included from py39-pytorch/work/pytorch-1.12.0/third_party/fbgemm/third_party/asmjit/src/asmjit/core/archtraits.cpp:25:
In file included from py39-pytorch/work/pytorch-1.12.0/third_party/fbgemm/third_party/asmjit/src/asmjit/core/../core/archtraits.h:28:
py39-pytorch/work/pytorch-1.12.0/third_party/fbgemm/third_party/asmjit/src/asmjit/core/../core/operand.h:910:79:
error: use of bitwise '&' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
  static inline bool isGp(const Operand_& op, uint32_t rId) noexcept { return isGp(op) & (op.id() == rId); }
                                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                       &&

Example builds, for py39-pytorch:

It appears (?) that MPS functionality is only present in 10.13 and later. Assuming that's the case, we shouldn't declare the variant for 10.12 and earlier.

As for the current failure: Presumably we should be able to ensure -Wbitwise-instead-of-logical is simply a warning, rather than an error.

Change History (9)

comment:1 Changed 2 years ago by Christopher Nielsen <mascguy@…>

In 217f82b3d74997385429448e06addc1322d09fb3/macports-ports (master):

py-pytorch: mps: only enable for 10.13 and later

  • Also disable compilation error bitwise-instead-of-logical

See: #65682

comment:2 in reply to:  1 ; Changed 2 years ago by essandess (Steve Smith)

Replying to Christopher Nielsen <mascguy@…>:

In 217f82b3d74997385429448e06addc1322d09fb3/macports-ports (master):

py-pytorch: mps: only enable for 10.13 and later

  • Also disable compilation error bitwise-instead-of-logical

See: #65682

Should this be revbumped because there's a compilation change?

comment:3 in reply to:  2 Changed 2 years ago by mascguy (Christopher Nielsen)

Replying to essandess:

Should this be revbumped because there's a compilation change?

No, as we're not materially changing anything. Rather, we're simply ensuring that builds don't fail, for the bitwise-instead-of-logical case.

comment:4 Changed 2 years ago by mascguy (Christopher Nielsen)

Resolution: fixed
Status: assignedclosed

comment:5 Changed 2 years ago by mascguy (Christopher Nielsen)

Resolution: fixed
Status: closedreopened

Still failing, might be fixable by specifying the cxx standard though.

comment:6 Changed 2 years ago by Christopher Nielsen <mascguy@…>

Resolution: fixed
Status: reopenedclosed

In be5cf4a21f14f2df6d65da41bc596ace97126785/macports-ports (master):

py-pytorch: pass compiler flags via CMAKE_CXX_FLAGS
See: 217f82b3d74997385429448e06addc1322d09fb3/macports-ports
Fixes: #65682

comment:7 Changed 2 years ago by mascguy (Christopher Nielsen)

Resolution: fixed
Status: closedreopened

comment:8 Changed 2 years ago by Christopher Nielsen <mascguy@…>

Resolution: fixed
Status: reopenedclosed

In 0c7f7c966283cd32f7910b3ad4189b667cd189da/macports-ports (master):

py-pytorch: use -Wno-error, for no-bitwise-instead-of-logical
See: be5cf4a21f14f2df6d65da41bc596ace97126785/macports-ports
Fixes: #65682

comment:9 Changed 2 years ago by mascguy (Christopher Nielsen)

Steve, at the risk of jinxing myself, the builds look good so far. And if nothing else, the bitwise failure is fixed.

I also queued 10.12 and 10.13 rebuilds, for py-torchaudio, py-pytorch-ligtning, and py-fairseq.

Note: See TracTickets for help on using tickets.