pytorch FTBFS with Python 3.11 as default version

Bug #2002685 reported by Dan Bungert
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pytorch (Debian)
Fix Released
Unknown
pytorch (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Imported from Debian bug http://bugs.debian.org/1027851:

Source: pytorch
Version: 1.12.1-1
Severity: serious
Forwarded: https://github.com/pytorch/pytorch/pull/81242

https://buildd.debian.org/status/fetch.php?pkg=pytorch&arch=amd64&ver=1.12.1-1%2Bb2&stamp=1672759960&raw=0

...
FAILED: caffe2/torch/CMakeFiles/torch_python.dir/csrc/Stream.cpp.o
/usr/bin/c++ -DAT_PER_OPERATOR_HEADERS -DBUILDING_TESTS -DGFLAGS_IS_A_DLL=0 -DGLOG_CUSTOM_PREFIX_SUPPORT -DHAVE_MALLOC_USABLE_SIZE=1 -DHAVE_MMAP=1 -DHAVE_SHM_OPEN=1 -DHAVE_SHM_UNLINK=1 -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx -DTHP_BUILD_MAIN_LIB -DUSE_C10D -DUSE_C10D_GLOO -DUSE_DISTRIBUTED -DUSE_EXTERNAL_MZCRC -DUSE_NUMPY -DUSE_RPC -DUSE_TENSORPIPE -DUSE_VALGRIND -D_FILE_OFFSET_BITS=64 -Dtorch_python_EXPORTS -I/<<PKGBUILDDIR>>/build/aten/src -I/<<PKGBUILDDIR>>/aten/src -I/<<PKGBUILDDIR>>/build -I/<<PKGBUILDDIR>> -I/<<PKGBUILDDIR>>/cmake/../third_party/benchmark/include -I/<<PKGBUILDDIR>>/debian/foxi -I/<<PKGBUILDDIR>>/build/debian/foxi -I/<<PKGBUILDDIR>>/torch/.. -I/<<PKGBUILDDIR>>/torch/../aten/src -I/<<PKGBUILDDIR>>/torch/../aten/src/TH -I/<<PKGBUILDDIR>>/build/caffe2/aten/src -I/<<PKGBUILDDIR>>/build/third_party -I/<<PKGBUILDDIR>>/build/third_party/onnx -I/<<PKGBUILDDIR>>/torch/../third_party/valgrind-headers -I/<<PKGBUILDDIR>>/torch/../third_party/gloo -I/<<PKGBUILDDIR>>/torch/../third_party/onnx -I/<<PKGBUILDDIR>>/torch/../third_party/flatbuffers/include -I/<<PKGBUILDDIR>>/torch/csrc -I/<<PKGBUILDDIR>>/torch/csrc/api/include -I/<<PKGBUILDDIR>>/torch/lib -I/<<PKGBUILDDIR>>/torch/lib/libshm -I/<<PKGBUILDDIR>>/torch/csrc/distributed -I/<<PKGBUILDDIR>>/torch/csrc/api -I/<<PKGBUILDDIR>>/c10/.. -I/<<PKGBUILDDIR>>/torch/lib/libshm/../../../torch/lib -isystem /<<PKGBUILDDIR>>/build/third_party/gloo -isystem /<<PKGBUILDDIR>>/cmake/../third_party/gloo -isystem /<<PKGBUILDDIR>>/cmake/../third_party/googletest/googlemock/include -isystem /<<PKGBUILDDIR>>/cmake/../third_party/googletest/googletest/include -isystem /usr/include/opencv4 -isystem /usr/include/eigen3 -isystem /usr/include/python3.11 -isystem /usr/lib/python3/dist-packages/numpy/core/include -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -gsplit-dwarf -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Werror=cast-function-type -Wno-stringop-overflow -DHAVE_AVX512_CPU_DEFINITION -DHAVE_AVX2_CPU_DEFINITION -O2 -g -DNDEBUG -fPIC -DCAFFE2_USE_GLOO -DTH_HAVE_THREAD -Wno-unused-variable -fno-strict-aliasing -Wno-write-strings -Wno-strict-aliasing -std=gnu++14 -MD -MT caffe2/torch/CMakeFiles/torch_python.dir/csrc/Stream.cpp.o -MF caffe2/torch/CMakeFiles/torch_python.dir/csrc/Stream.cpp.o.d -o caffe2/torch/CMakeFiles/torch_python.dir/csrc/Stream.cpp.o -c /<<PKGBUILDDIR>>/torch/csrc/Stream.cpp
In file included from /usr/include/python3.11/Python.h:44,
                 from /usr/include/pybind11/detail/common.h:266,
                 from /usr/include/pybind11/attr.h:13,
                 from /usr/include/pybind11/detail/class.h:12,
                 from /usr/include/pybind11/pybind11.h:13,
                 from /<<PKGBUILDDIR>>/torch/csrc/Stream.cpp:1:
/<<PKGBUILDDIR>>/torch/csrc/Stream.cpp: In function ‘void THPStream_init(PyObject*)’:
/<<PKGBUILDDIR>>/torch/csrc/Stream.cpp:112:3: error: lvalue required as left operand of assignment
  112 | Py_TYPE(&THPStreamType) = &PyType_Type;
      | ^~~~~~~
...

Dan Bungert (dbungert)
tags: added: update-excuse
Changed in pytorch (Debian):
importance: Undecided → Unknown
status: New → Confirmed
Revision history for this message
Bryce Harrington (bryce) wrote :

The upstream PR is closed as fixed. There's a 1.13.1 release that likely has the necessary fixes. Merging that (ahead of or with Debian) could be the best path forward here. The PR lists a half dozen commits involved in the fix.

Note there are other pytorch-* components some of which rdepend on pytorch, and perhaps other packages that use it as a dependency.

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

Bryce, there is Debian activity, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1027851#26

Can you please coordinate and do the work there?

Changed in pytorch (Ubuntu):
status: New → Fix Released
Changed in pytorch (Debian):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.