Expected behavior
TVM 0.13.0 is not working with Python 3.8
Actual behavior
Build failed with
In file included from ml_dtypes/_src/dtypes.cc:33:0:
ml_dtypes/_src/custom_float.h: In function ‘bool ml_dtypes::RegisterFloatDtype(PyObject*)’:
ml_dtypes/_src/custom_float.h:942:3: error: there are no arguments to ‘Py_SET_TYPE’ that depend on a template parameter, so a declaration of ‘Py_SET_TYPE’ must be available [-fpermissive]
Py_SET_TYPE(&descr_proto, &PyArrayDescr_Type);
^~~~~~~~~~~
ml_dtypes/_src/custom_float.h:942:3: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
In file included from ml_dtypes/_src/dtypes.cc:34:0:
ml_dtypes/_src/int4_numpy.h: In function ‘bool ml_dtypes::RegisterInt4Dtype(PyObject*)’:
ml_dtypes/_src/int4_numpy.h:842:3: error: there are no arguments to ‘Py_SET_TYPE’ that depend on a template parameter, so a declaration of ‘Py_SET_TYPE’ must be available [-fpermissive]
Py_SET_TYPE(&descr_proto, &PyArrayDescr_Type);
^~~~~~~~~~~
In file included from ml_dtypes/_src/dtypes.cc:33:0:
ml_dtypes/_src/custom_float.h: In instantiation of ‘bool ml_dtypes::RegisterFloatDtype(PyObject*) [with T = Eigen::bfloat16; PyObject = _object]’:
ml_dtypes/_src/dtypes.cc:226:48: required from here
ml_dtypes/_src/custom_float.h:942:14: error: ‘Py_SET_TYPE’ was not declared in this scope
Py_SET_TYPE(&descr_proto, &PyArrayDescr_Type);
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ml_dtypes/_src/custom_float.h:942:14: note: suggested alternative: ‘__S16_TYPE’
Py_SET_TYPE(&descr_proto, &PyArrayDescr_Type);
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__S16_TYPE
ml_dtypes/_src/custom_float.h: In instantiation of ‘bool ml_dtypes::RegisterFloatDtype(PyObject*) [with T = ml_dtypes::float8_internal::float8_e4m3b11fnuz; PyObject = _object]’:
ml_dtypes/_src/dtypes.cc:229:58: required from here
ml_dtypes/_src/custom_float.h:942:14: error: ‘Py_SET_TYPE’ was not declared in this scope
ml_dtypes/_src/custom_float.h:942:14: note: suggested alternative: ‘__S16_TYPE’
Py_SET_TYPE(&descr_proto, &PyArrayDescr_Type);
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__S16_TYPE
ml_dtypes/_src/custom_float.h: In instantiation of ‘bool ml_dtypes::RegisterFloatDtype(PyObject*) [with T = ml_dtypes::float8_internal::float8_e4m3fn; PyObject = _object]’:
ml_dtypes/_src/dtypes.cc:232:53: required from here
ml_dtypes/_src/custom_float.h:942:14: error: ‘Py_SET_TYPE’ was not declared in this scope
ml_dtypes/_src/custom_float.h:942:14: note: suggested alternative: ‘__S16_TYPE’
Py_SET_TYPE(&descr_proto, &PyArrayDescr_Type);
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__S16_TYPE
ml_dtypes/_src/custom_float.h: In instantiation of ‘bool ml_dtypes::RegisterFloatDtype(PyObject*) [with T = ml_dtypes::float8_internal::float8_e4m3fnuz; PyObject = _object]’:
ml_dtypes/_src/dtypes.cc:235:55: required from here
ml_dtypes/_src/custom_float.h:942:14: error: ‘Py_SET_TYPE’ was not declared in this scope
ml_dtypes/_src/custom_float.h:942:14: note: suggested alternative: ‘__S16_TYPE’
Py_SET_TYPE(&descr_proto, &PyArrayDescr_Type);
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__S16_TYPE
ml_dtypes/_src/custom_float.h: In instantiation of ‘bool ml_dtypes::RegisterFloatDtype(PyObject*) [with T = ml_dtypes::float8_internal::float8_e5m2; PyObject = _object]’:
ml_dtypes/_src/dtypes.cc:238:51: required from here
ml_dtypes/_src/custom_float.h:942:14: error: ‘Py_SET_TYPE’ was not declared in this scope
ml_dtypes/_src/custom_float.h:942:14: note: suggested alternative: ‘__S16_TYPE’
Py_SET_TYPE(&descr_proto, &PyArrayDescr_Type);
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__S16_TYPE
ml_dtypes/_src/custom_float.h: In instantiation of ‘bool ml_dtypes::RegisterFloatDtype(PyObject*) [with T = ml_dtypes::float8_internal::float8_e5m2fnuz; PyObject = _object]’:
ml_dtypes/_src/dtypes.cc:241:55: required from here
ml_dtypes/_src/custom_float.h:942:14: error: ‘Py_SET_TYPE’ was not declared in this scope
ml_dtypes/_src/custom_float.h:942:14: note: suggested alternative: ‘__S16_TYPE’
Py_SET_TYPE(&descr_proto, &PyArrayDescr_Type);
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__S16_TYPE
In file included from ml_dtypes/_src/dtypes.cc:34:0:
ml_dtypes/_src/int4_numpy.h: In instantiation of ‘bool ml_dtypes::RegisterInt4Dtype(PyObject*) [with T = ml_dtypes::intN<4, signed char>; PyObject = _object]’:
ml_dtypes/_src/dtypes.cc:245:43: required from here
ml_dtypes/_src/int4_numpy.h:842:14: error: ‘Py_SET_TYPE’ was not declared in this scope
Py_SET_TYPE(&descr_proto, &PyArrayDescr_Type);
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ml_dtypes/_src/int4_numpy.h:842:14: note: suggested alternative: ‘__S16_TYPE’
Py_SET_TYPE(&descr_proto, &PyArrayDescr_Type);
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__S16_TYPE
ml_dtypes/_src/int4_numpy.h: In instantiation of ‘bool ml_dtypes::RegisterInt4Dtype(PyObject*) [with T = ml_dtypes::intN<4, unsigned char>; PyObject = _object]’:
ml_dtypes/_src/dtypes.cc:248:44: required from here
ml_dtypes/_src/int4_numpy.h:842:14: error: ‘Py_SET_TYPE’ was not declared in this scope
ml_dtypes/_src/int4_numpy.h:842:14: note: suggested alternative: ‘__S16_TYPE’
Py_SET_TYPE(&descr_proto, &PyArrayDescr_Type);
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__S16_TYPE
build/bdist.linux-x86_64/egg/tvm/3rdparty/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_device.py:85: SyntaxWarning: "is" with a literal. Did you mean "=="?
if mma_tp is 'hmma1688':
build/bdist.linux-x86_64/egg/tvm/3rdparty/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_device.py:88: SyntaxWarning: "is" with a literal. Did you mean "=="?
elif mma_tp is 'imma8816':
build/bdist.linux-x86_64/egg/tvm/3rdparty/libflash_attn/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_sample.py:185: SyntaxWarning: "is" with a literal. Did you mean "=="?
if self.fuse_gemm_info[i]['A_format'] is 'Col':
build/bdist.linux-x86_64/egg/tvm/3rdparty/libflash_attn/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_sample.py:187: SyntaxWarning: "is" with a literal. Did you mean "=="?
if self.fuse_gemm_info[i]['B_format'] is 'Row':
build/bdist.linux-x86_64/egg/tvm/3rdparty/libflash_attn/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_sample.py:189: SyntaxWarning: "is" with a literal. Did you mean "=="?
if self.fuse_gemm_info[i]['C_format'] is 'Col':
build/bdist.linux-x86_64/egg/tvm/3rdparty/libflash_attn/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_turing_and_volta.py:84: SyntaxWarning: "is" with a literal. Did you mean "=="?
if self.fuse_gemm_info[i]['B_format'] is 'Row':
build/bdist.linux-x86_64/egg/tvm/3rdparty/libflash_attn/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_turing_and_volta.py:295: SyntaxWarning: "is" with a literal. Did you mean "=="?
if self.fuse_gemm_info[i]['A_format'] is 'Col':
build/bdist.linux-x86_64/egg/tvm/3rdparty/libflash_attn/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_turing_and_volta.py:297: SyntaxWarning: "is" with a literal. Did you mean "=="?
if self.fuse_gemm_info[i]['B_format'] is 'Row':
build/bdist.linux-x86_64/egg/tvm/3rdparty/libflash_attn/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_turing_and_volta.py:299: SyntaxWarning: "is" with a literal. Did you mean "=="?
if self.fuse_gemm_info[i]['C_format'] is 'Col':
build/bdist.linux-x86_64/egg/tvm/3rdparty/libflash_attn/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_device.py:85: SyntaxWarning: "is" with a literal. Did you mean "=="?
if mma_tp is 'hmma1688':
build/bdist.linux-x86_64/egg/tvm/3rdparty/libflash_attn/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_device.py:88: SyntaxWarning: "is" with a literal. Did you mean "=="?
elif mma_tp is 'imma8816':
/usr/lib64/python3.8/site-packages/tvm-0.13.0-py3.8-linux-x86_64.egg/tvm/3rdparty/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_device.py:85: SyntaxWarning: "is" with a literal. Did you mean "=="?
if mma_tp is 'hmma1688':
/usr/lib64/python3.8/site-packages/tvm-0.13.0-py3.8-linux-x86_64.egg/tvm/3rdparty/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_device.py:88: SyntaxWarning: "is" with a literal. Did you mean "=="?
elif mma_tp is 'imma8816':
/usr/lib64/python3.8/site-packages/tvm-0.13.0-py3.8-linux-x86_64.egg/tvm/3rdparty/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_sample.py:185: SyntaxWarning: "is" with a literal. Did you mean "=="?
if self.fuse_gemm_info[i]['A_format'] is 'Col':
/usr/lib64/python3.8/site-packages/tvm-0.13.0-py3.8-linux-x86_64.egg/tvm/3rdparty/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_sample.py:187: SyntaxWarning: "is" with a literal. Did you mean "=="?
if self.fuse_gemm_info[i]['B_format'] is 'Row':
/usr/lib64/python3.8/site-packages/tvm-0.13.0-py3.8-linux-x86_64.egg/tvm/3rdparty/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_sample.py:189: SyntaxWarning: "is" with a literal. Did you mean "=="?
if self.fuse_gemm_info[i]['C_format'] is 'Col':
/usr/lib64/python3.8/site-packages/tvm-0.13.0-py3.8-linux-x86_64.egg/tvm/3rdparty/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_turing_and_volta.py:84: SyntaxWarning: "is" with a literal. Did you mean "=="?
if self.fuse_gemm_info[i]['B_format'] is 'Row':
/usr/lib64/python3.8/site-packages/tvm-0.13.0-py3.8-linux-x86_64.egg/tvm/3rdparty/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_turing_and_volta.py:295: SyntaxWarning: "is" with a literal. Did you mean "=="?
if self.fuse_gemm_info[i]['A_format'] is 'Col':
/usr/lib64/python3.8/site-packages/tvm-0.13.0-py3.8-linux-x86_64.egg/tvm/3rdparty/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_turing_and_volta.py:297: SyntaxWarning: "is" with a literal. Did you mean "=="?
if self.fuse_gemm_info[i]['B_format'] is 'Row':
/usr/lib64/python3.8/site-packages/tvm-0.13.0-py3.8-linux-x86_64.egg/tvm/3rdparty/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_turing_and_volta.py:299: SyntaxWarning: "is" with a literal. Did you mean "=="?
if self.fuse_gemm_info[i]['C_format'] is 'Col':
/usr/lib64/python3.8/site-packages/tvm-0.13.0-py3.8-linux-x86_64.egg/tvm/3rdparty/libflash_attn/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_device.py:85: SyntaxWarning: "is" with a literal. Did you mean "=="?
if mma_tp is 'hmma1688':
/usr/lib64/python3.8/site-packages/tvm-0.13.0-py3.8-linux-x86_64.egg/tvm/3rdparty/libflash_attn/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_device.py:88: SyntaxWarning: "is" with a literal. Did you mean "=="?
elif mma_tp is 'imma8816':
/usr/lib64/python3.8/site-packages/tvm-0.13.0-py3.8-linux-x86_64.egg/tvm/3rdparty/libflash_attn/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_sample.py:185: SyntaxWarning: "is" with a literal. Did you mean "=="?
if self.fuse_gemm_info[i]['A_format'] is 'Col':
/usr/lib64/python3.8/site-packages/tvm-0.13.0-py3.8-linux-x86_64.egg/tvm/3rdparty/libflash_attn/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_sample.py:187: SyntaxWarning: "is" with a literal. Did you mean "=="?
if self.fuse_gemm_info[i]['B_format'] is 'Row':
/usr/lib64/python3.8/site-packages/tvm-0.13.0-py3.8-linux-x86_64.egg/tvm/3rdparty/libflash_attn/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_sample.py:189: SyntaxWarning: "is" with a literal. Did you mean "=="?
if self.fuse_gemm_info[i]['C_format'] is 'Col':
/usr/lib64/python3.8/site-packages/tvm-0.13.0-py3.8-linux-x86_64.egg/tvm/3rdparty/libflash_attn/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_turing_and_volta.py:84: SyntaxWarning: "is" with a literal. Did you mean "=="?
if self.fuse_gemm_info[i]['B_format'] is 'Row':
/usr/lib64/python3.8/site-packages/tvm-0.13.0-py3.8-linux-x86_64.egg/tvm/3rdparty/libflash_attn/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_turing_and_volta.py:295: SyntaxWarning: "is" with a literal. Did you mean "=="?
if self.fuse_gemm_info[i]['A_format'] is 'Col':
/usr/lib64/python3.8/site-packages/tvm-0.13.0-py3.8-linux-x86_64.egg/tvm/3rdparty/libflash_attn/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_turing_and_volta.py:297: SyntaxWarning: "is" with a literal. Did you mean "=="?
if self.fuse_gemm_info[i]['B_format'] is 'Row':
/usr/lib64/python3.8/site-packages/tvm-0.13.0-py3.8-linux-x86_64.egg/tvm/3rdparty/libflash_attn/cutlass/examples/44_multi_gemm_ir_and_codegen/ir_gen/gen_turing_and_volta.py:299: SyntaxWarning: "is" with a literal. Did you mean "=="?
if self.fuse_gemm_info[i]['C_format'] is 'Col':
/usr/local/lib/python3.8/site[[[###REDACTED_AWS_SECRET_KEY_REDACTED###]]]py:108: _BetaConfiguration: Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*.
warnings.warn(msg, _BetaConfiguration)
/usr/local/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
error: Setup script exited with error: command '/usr/bin/gcc' failed with exit code 1
Environment
Any environment details, such as: Operating System, TVM version, etc
Operating System: AL2 TVM version : Python 3.8 Cuda: 11.8
Command used to install -
git clone --recursive https://github.com/apache/incubator-tvm tvm && \
cd tvm && \
git checkout tags/v0.13.0 && \
git submodule init && \
git submodule update && \
mkdir build && \
cd build && \
cmake -DUSE_CUDA=ON -DUSE_CUDNN=ON -DUSE_CUBLAS=ON -DUSE_THRUST=ON -DUSE_LLVM=ON -DCMAKE_CUDA_ARCHITECTURES=70 .. && \
make -j$(nproc) && \
cd ../python && \
python3.8 setup.py install
Using
sed -i '/("matplotlib", None),/a\ ("ml_dtypes", "==0.2.0"),' gen_requirements.py
fixed the issue