M1-Mac使用cli_demo.py遇到的问题

环境:python3.11.2
运行python3 cli_demo.py chatglm报错如下:

clang: warning: argument unused during compilation: '-undefined dynamic_lookup' [-Wunused-command-line-argument]
In file included from /Users/ansell/.cache/jittor/jt1.3.7/clang12.0.5/py3.11.2/macOS-13.0-armx0c/AppleM1/stable/gen/pyjt_miniz.cc:3:
/opt/homebrew/lib/python3.11/site-packages/jittor/src/pyjt/py_converter.h:647:27: error: no matching function for call to 'to_py_object'
        PyObjHolder value(to_py_object<typename T::mapped_type>(kv.second));
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/ansell/.cache/jittor/jt1.3.7/clang12.0.5/py3.11.2/macOS-13.0-armx0c/AppleM1/stable/gen/pyjt_miniz.cc:76:28: note: in instantiation of function template specialization 'jittor::to_py_object<std::__1::map<std::__1::basic_string<char>, unsigned long long>>' requested here
                    return to_py_object<map<string,uint64>>(((GET_RAW_PTR(ZipFile,self))->list()));
                           ^
/opt/homebrew/lib/python3.11/site-packages/jittor/src/pyjt/py_converter.h:42:27: note: candidate template ignored: requirement 'std::is_same<unsigned long long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>::value' was not satisfied [with T = unsigned long long]
DEF_IS(string, PyObject*) to_py_object(const string& a) {
                          ^
/opt/homebrew/lib/python3.11/site-packages/jittor/src/pyjt/py_converter.h:58:25: note: candidate template ignored: requirement 'std::is_same<unsigned long long, bool>::value' was not satisfied [with T = unsigned long long]
DEF_IS(bool, PyObject*) to_py_object(const T& a) {
                        ^
/opt/homebrew/lib/python3.11/site-packages/jittor/src/pyjt/py_converter.h:74:24: note: candidate template ignored: requirement 'std::is_same<unsigned long long, int>::value' was not satisfied [with T = unsigned long long]
DEF_IS(int, PyObject*) to_py_object(const T& a) {
                       ^
/opt/homebrew/lib/python3.11/site-packages/jittor/src/pyjt/py_converter.h:87:27: note: candidate template ignored: requirement 'std::is_same<unsigned long long, unsigned long>::value' was not satisfied [with T = unsigned long long]
DEF_IS(size_t, PyObject*) to_py_object(const T& a) {
                          ^
/opt/homebrew/lib/python3.11/site-packages/jittor/src/pyjt/py_converter.h:100:26: note: candidate template ignored: requirement 'std::is_same<unsigned long long, long long>::value' was not satisfied [with T = unsigned long long]
DEF_IS(int64, PyObject*) to_py_object(const T& a) {
                         ^
/opt/homebrew/lib/python3.11/site-packages/jittor/src/pyjt/py_converter.h:128:28: note: candidate template ignored: requirement 'std::is_same<unsigned long long, double>::value' was not satisfied [with T = unsigned long long]
DEF_IS(float64, PyObject*) to_py_object(const T& a) {
                           ^
/opt/homebrew/lib/python3.11/site-packages/jittor/src/pyjt/py_converter.h:166:31: note: candidate template ignored: requirement 'std::is_same<unsigned long long, jittor::DumpGraphs>::value' was not satisfied [with T = unsigned long long]
DEF_IS(DumpGraphs, PyObject*) to_py_object(T&& a) {
                              ^
/opt/homebrew/lib/python3.11/site-packages/jittor/src/pyjt/py_converter.h:188:28: note: candidate template ignored: requirement 'std::is_same<unsigned long long, jittor::MemInfo>::value' was not satisfied [with T = unsigned long long]
DEF_IS(MemInfo, PyObject*) to_py_object(const T& a) {
                           ^
/opt/homebrew/lib/python3.11/site-packages/jittor/src/pyjt/py_converter.h:207:28: note: candidate template ignored: requirement 'std::is_same<unsigned long long, jittor::ZipFile>::value' was not satisfied [with T = unsigned long long]
DEF_IS(ZipFile, PyObject*) to_py_object(const T& a) {
                           ^
/opt/homebrew/lib/python3.11/site-packages/jittor/src/pyjt/py_converter.h:232:31: note: candidate template ignored: requirement 'std::is_same<unsigned long long, jittor::NanoString>::value' was not satisfied [with T = unsigned long long]
DEF_IS(NanoString, PyObject*) to_py_object(T a) {
                              ^
/opt/homebrew/lib/python3.11/site-packages/jittor/src/pyjt/py_converter.h:268:31: note: candidate template ignored: requirement 'std::is_same<unsigned long long, jittor::NanoVector>::value' was not satisfied [with T = unsigned long long]
DEF_IS(NanoVector, PyObject*) to_py_object(T a) {
                              ^
/opt/homebrew/lib/python3.11/site-packages/jittor/src/pyjt/py_converter.h:309:30: note: candidate template ignored: requirement 'std::is_same<unsigned long long, jittor::ArrayArgs>::value' was not satisfied [with T = unsigned long long]
DEF_IS(ArrayArgs, PyObject*) to_py_object(const T& a) {
                             ^
/opt/homebrew/lib/python3.11/site-packages/jittor/src/pyjt/py_converter.h:405:31: note: candidate template ignored: requirement 'std::is_same<unsigned long long, jittor::VarHolder *>::value' was not satisfied [with T = unsigned long long]
DEF_IS(VarHolder*, PyObject*) to_py_object(T a) {
                              ^
/opt/homebrew/lib/python3.11/site-packages/jittor/src/pyjt/py_converter.h:429:29: note: candidate template ignored: requirement 'std::is_same<unsigned long long, jittor::DataView>::value' was not satisfied [with T = unsigned long long]
DEF_IS(DataView, PyObject*) to_py_object(T a) {
                            ^
/opt/homebrew/lib/python3.11/site-packages/jittor/src/pyjt/py_converter.h:462:29: note: candidate template ignored: requirement 'std::is_same<unsigned long long, jittor::ItemData>::value' was not satisfied [with T = unsigned long long]
DEF_IS(ItemData, PyObject*) to_py_object(T a) {
                            ^
/opt/homebrew/lib/python3.11/site-packages/jittor/src/pyjt/py_converter.h:526:29: note: candidate template ignored: requirement 'is_vector<unsigned long long>::value' was not satisfied [with T = unsigned long long]
DEF_IS_1(vector, PyObject*) to_py_object(const T& a) {
                            ^
/opt/homebrew/lib/python3.11/site-packages/jittor/src/pyjt/py_converter.h:548:38: note: candidate template ignored: requirement 'is_vector_to_tuple<unsigned long long>::value' was not satisfied [with T = unsigned long long]
DEF_IS_1(vector_to_tuple, PyObject*) to_py_object(const T& a) {
                                     ^
/opt/homebrew/lib/python3.11/site-packages/jittor/src/pyjt/py_converter.h:559:29: note: candidate template ignored: requirement 'is_vector<unsigned long long>::value' was not satisfied [with T = unsigned long long]
DEF_IS_1(vector, PyObject*) to_py_object(T&& a) {
                            ^
/opt/homebrew/lib/python3.11/site-packages/jittor/src/pyjt/py_converter.h:609:36: note: candidate template ignored: requirement 'is_unordered_map<unsigned long long>::value' was not satisfied [with T = unsigned long long]
DEF_IS_2(unordered_map, PyObject*) to_py_object(const T& a) {
                                   ^
/opt/homebrew/lib/python3.11/site-packages/jittor/src/pyjt/py_converter.h:643:26: note: candidate template ignored: requirement 'is_map<unsigned long long>::value' was not satisfied [with T = unsigned long long]
DEF_IS_2(map, PyObject*) to_py_object(const T& a) {
                         ^
1 error generated.
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
                    ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/jittor_utils/__init__.py", line 197, in do_compile
    return cc.cache_compile(cmd, cache_path, jittor_path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: [f 0404 16:40:50.475736 00 log.cc:608] Check failed ret(256) == 0(0) Run cmd failed: "/usr/bin/clang++" "/Users/ansell/.cache/jittor/jt1.3.7/clang12.0.5/py3.11.2/macOS-13.0-armx0c/AppleM1/stable/gen/pyjt_miniz.cc"   -Wall -Wno-unknown-pragmas -std=c++14 -fPIC  -mcpu=apple-a14  -fdiagnostics-color=always  -undefined dynamic_lookup  -I/opt/homebrew/opt/libomp/include  -I"/opt/homebrew/lib/python3.11/site-packages/jittor/src" -I/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11 -I/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11 -I"/Users/ansell/.cache/jittor/jt1.3.7/clang12.0.5/py3.11.2/macOS-13.0-armx0c/AppleM1/stable"   -O2   -c -o "/Users/ansell/.cache/jittor/jt1.3.7/clang12.0.5/py3.11.2/macOS-13.0-armx0c/AppleM1/stable/obj_files/pyjt_miniz.cc.o"
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/ansell/chat/JittorLLMs/cli_demo.py", line 8, in <module>
    model = models.get_model(args)
            ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ansell/chat/JittorLLMs/models/__init__.py", line 38, in get_model
    globals()[f"get_{model_name}"]()
  File "/Users/ansell/chat/JittorLLMs/models/util.py", line 51, in get_chatglm
    new_path.append(download_fromhub(f"jittorhub://{f}", tdir="chat-glm"))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ansell/chat/JittorLLMs/models/util.py", line 5, in download_fromhub
    import jittor as jt
  File "/opt/homebrew/lib/python3.11/site-packages/jittor/__init__.py", line 18, in <module>
    from . import compiler
  File "/opt/homebrew/lib/python3.11/site-packages/jittor/compiler.py", line 1356, in <module>
    compile(cc_path, cc_flags+opt_flags, files, 'jittor_core'+extension_suffix)
  File "/opt/homebrew/lib/python3.11/site-packages/jittor/compiler.py", line 151, in compile
    jit_utils.run_cmds(cmds, cache_path, jittor_path, "Compiling "+base_output)
  File "/opt/homebrew/lib/python3.11/site-packages/jittor_utils/__init__.py", line 251, in run_cmds
    for i,_ in enumerate(p.imap_unordered(do_compile, cmds)):
  File "/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/pool.py", line 873, in next
    raise value
RuntimeError: [f 0404 16:40:50.475736 00 log.cc:608] Check failed ret(256) == 0(0) Run cmd failed: "/usr/bin/clang++" "/Users/ansell/.cache/jittor/jt1.3.7/clang12.0.5/py3.11.2/macOS-13.0-armx0c/AppleM1/stable/gen/pyjt_miniz.cc"   -Wall -Wno-unknown-pragmas -std=c++14 -fPIC  -mcpu=apple-a14  -fdiagnostics-color=always  -undefined dynamic_lookup  -I/opt/homebrew/opt/libomp/include  -I"/opt/homebrew/lib/python3.11/site-packages/jittor/src" -I/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11 -I/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11 -I"/Users/ansell/.cache/jittor/jt1.3.7/clang12.0.5/py3.11.2/macOS-13.0-armx0c/AppleM1/stable"   -O2   -c -o "/Users/ansell/.cache/jittor/jt1.3.7/clang12.0.5/py3.11.2/macOS-13.0-armx0c/AppleM1/stable/obj_files/pyjt_miniz.cc.o"

请问如何解决?

您好,请更新jittor到1.3.7.5即可fix该问题