Segment fault with spdlog fmt 11
Closed this issue · 2 comments
Try to print float value with spdlog v1.15.3
but get segment fault on fmt::v11::detail::write_significand
Seems durning #7 we already got float value
0x00007ffe2f9ed29d in fmt::v11::detail::write<char, fmt::v11::basic_appender, double, 0> (out=..., value=15.020027160644531, specs=..., loc=...) at /root/Llama-3-8B-Instruct/bo/frameworks.ai.xengine/build/ns_model/_deps/spdlog-src/include/spdlog/fmt/bundled/format.h:3361
Don't know why final fault.
0x00007fffea07e64c in fmt::v11::basic_appender fmt::v11::detail::write_significand<fmt::v11::basic_appender, char, char const*, fmt::v11::detail::digit_grouping >(fmt::v11::basic_appender, char const*, int, int, char, fmt::v11::detail::digit_grouping const&) () from /usr/local/lib/py
thon3.10/dist-packages/torch/lib/libtorch_cpu.so
(gdb)
(gdb)
(gdb)
(gdb)
(gdb) bt
#0 0x00007fffea07e64c in fmt::v11::basic_appender fmt::v11::detail::write_significand<fmt::v11::basic_appender, char, char const*, fmt::v11::detail::digit_grouping >(fmt::v11::basic_appender, char const*, int, int, char, fmt::v11::detail::digit_grouping const&) ()
from /usr/local/lib/python3.10/dist-packages/torch/lib/libtorch_cpu.so
#1 0x00007ffe2f9fa172 in fmt::v11::detail::do_write_float<char, fmt::v11::basic_appender, fmt::v11::detail::big_decimal_fp, fmt::v11::detail::digit_grouping >(fmt::v11::basic_appender, fmt::v11::detail::big_decimal_fp const&, fmt::v11::format_specs const&, fmt::v11::sign, int, fmt::v11::detail:
:locale_ref)::{lambda(fmt::v11::basic_appender)#4}::operator()(fmt::v11::basic_appender) const (__closure=0x7fffffff9ba0, it=...) at /root/Llama-3-8B-Instruct/bo/frameworks.ai.xengine/build/ns_model/_deps/spdlog-src/include/spdlog/fmt/bundled/format.h:2414
#2 0x00007ffe2f9ff9d4 in fmt::v11::detail::write_padded<char, (fmt::v11::align)2, fmt::v11::basic_appender, fmt::v11::detail::do_write_float<char, fmt::v11::basic_appender, fmt::v11::detail::big_decimal_fp, fmt::v11::detail::digit_grouping >(fmt::v11::basic_appender, fmt::v11::detail::big
_decimal_fp const&, fmt::v11::format_specs const&, fmt::v11::sign, int, fmt::v11::detail::locale_ref)::{lambda(fmt::v11::basic_appender)#4}&>(fmt::v11::basic_appender, fmt::v11::format_specs const&, unsigned long, unsigned long, fmt::v11::detail::do_write_float<char, fmt::v11::basic_appender, fm
t::v11::detail::big_decimal_fp, fmt::v11::detail::digit_grouping >(fmt::v11::basic_appender, fmt::v11::detail::big_decimal_fp const&, fmt::v11::format_specs const&, fmt::v11::sign, int, fmt::v11::detail::locale_ref)::{lambda(fmt::v11::basic_appender)#4}&) (out=..., specs=..., size=5, width=5,
f=...) at /root/Llama-3-8B-Instruct/bo/frameworks.ai.xengine/build/ns_model/_deps/spdlog-src/include/spdlog/fmt/bundled/format.h:1645
#3 0x00007ffe2f9fe98c in fmt::v11::detail::write_padded<char, (fmt::v11::align)2, fmt::v11::basic_appender, fmt::v11::detail::do_write_float<char, fmt::v11::basic_appender, fmt::v11::detail::big_decimal_fp, fmt::v11::detail::digit_grouping >(fmt::v11::basic_appender, fmt::v11::detail::big
_decimal_fp const&, fmt::v11::format_specs const&, fmt::v11::sign, int, fmt::v11::detail::locale_ref)::{lambda(fmt::v11::basic_appender)#4}>(fmt::v11::basic_appender, fmt::v11::format_specs const&, unsigned long, fmt::v11::detail::do_write_float<char, fmt::v11::basic_appender, fmt::v11::detail::
big_decimal_fp, fmt::v11::detail::digit_grouping >(fmt::v11::basic_appender, fmt::v11::detail::big_decimal_fp const&, fmt::v11::format_specs const&, fmt::v11::sign, int, fmt::v11::detail::locale_ref)::{lambda(fmt::v11::basic_appender)#4}&&) (out=..., specs=..., size=5, f=...)
at /root/Llama-3-8B-Instruct/bo/frameworks.ai.xengine/build/ns_model/_deps/spdlog-src/include/spdlog/fmt/bundled/format.h:1654
#4 0x00007ffe2f9fa989 in fmt::v11::detail::do_write_float<char, fmt::v11::basic_appender, fmt::v11::detail::big_decimal_fp, fmt::v11::detail::digit_grouping > (out=..., f=..., specs=..., s=fmt::v11::sign::none, exp_upper=16, loc=...)
at /root/Llama-3-8B-Instruct/bo/frameworks.ai.xengine/build/ns_model/_deps/spdlog-src/include/spdlog/fmt/bundled/format.h:2412
#5 0x00007ffe2f9f4fe1 in fmt::v11::detail::write_float<char, fmt::v11::basic_appender, fmt::v11::detail::big_decimal_fp> (out=..., f=..., specs=..., s=fmt::v11::sign::none, exp_upper=16, loc=...)
at /root/Llama-3-8B-Instruct/bo/frameworks.ai.xengine/build/ns_model/_deps/spdlog-src/include/spdlog/fmt/bundled/format.h:2460
#6 0x00007ffe2f9f1143 in fmt::v11::detail::write_float<char, fmt::v11::basic_appender, double> (out=..., value=15.020027160644531, specs=..., loc=...) at /root/Llama-3-8B-Instruct/bo/frameworks.ai.xengine/build/ns_model/_deps/spdlog-src/include/spdlog/fmt/bundled/format.h:3352
#7 0x00007ffe2f9ed29d in fmt::v11::detail::write<char, fmt::v11::basic_appender, double, 0> (out=..., value=15.020027160644531, specs=..., loc=...) at /root/Llama-3-8B-Instruct/bo/frameworks.ai.xengine/build/ns_model/_deps/spdlog-src/include/spdlog/fmt/bundled/format.h:3361
#8 0x00007ffe2f9eb3b2 in fmt::v11::detail::arg_formatter::operator()<double, 0> (value=, this=) at /root/Llama-3-8B-Instruct/bo/frameworks.ai.xengine/build/ns_model/_deps/spdlog-src/include/spdlog/fmt/bundled/format.h:3499
#9 fmt::v11::basic_format_argfmt::v11::context::visit<fmt::v11::detail::arg_formatter > (vis=..., this=) at /root/Llama-3-8B-Instruct/bo/frameworks.ai.xengine/build/ns_model/_deps/spdlog-src/include/spdlog/fmt/bundled/base.h:2529
#10 fmt::v11::detail::format_handler::on_format_specs (this=0x7fffffffa1d0, id=1, begin=0x7ffe2fa07afe "} G (model size {:.2f} G)", end=0x7ffe2fa07b17 "") at /root/Llama-3-8B-Instruct/bo/frameworks.ai.xengine/build/ns_model/_deps/spdlog-src/include/spdlog/fmt/bundled/format.h:3628
#11 0x00007ffe2f9e6e82 in fmt::v11::detail::parse_replacement_field<char, fmt::v11::detail::format_handler&> (handler=..., end=, begin=0x7ffe2fa07afa ":.2f} G (model size {:.2f} G)")
at /root/Llama-3-8B-Instruct/bo/frameworks.ai.xengine/build/ns_model/_deps/spdlog-src/include/spdlog/fmt/bundled/base.h:1623
#12 fmt::v11::detail::parse_format_string<char, fmt::v11::detail::format_handler > (fmt=..., handler=...) at /root/Llama-3-8B-Instruct/bo/frameworks.ai.xengine/build/ns_model/_deps/spdlog-src/include/spdlog/fmt/bundled/base.h:1638
#13 0x00007ffe2f9df363 in fmt::v11::detail::vformat_to (buf=..., fmt=..., args=..., loc=...) at /root/Llama-3-8B-Instruct/bo/frameworks.ai.xengine/build/ns_model/_deps/spdlog-src/include/spdlog/fmt/bundled/format-inl.h:1457
#14 0x00007ffe2f90254e in fmt::v11::vformat_to<fmt::v11::basic_appender, 0> (out=..., fmt=..., args=...) at /root/Llama-3-8B-Instruct/bo/frameworks.ai.xengine/build/ns_model/deps/spdlog-src/include/spdlog/fmt/bundled/base.h:2837
#15 0x00007ffe2f8ed519 in spdlog::logger::log<char const (&) [5], double, double> (this=0x55556d957190, loc=..., lvl=spdlog::level::info, fmt=...) at /root/Llama-3-8B-Instruct/bo/frameworks.ai.xengine/build/ns_model/_deps/spdlog-src/include/spdlog/logger.h:328
#16 0x00007ffe2f8cff89 in spdlog::logger::log<char const (&) [5], double, double> (this=0x55556d957190, loc=..., lvl=spdlog::level::info, fmt=...) at /root/Llama-3-8B-Instruct/bo/frameworks.ai.xengine/build/ns_model/_deps/spdlog-src/include/spdlog/logger.h:80
#17 0x00007ffe2f8b2471 in spdlog::logger::log<char const (&) [5], double, double> (this=0x55556d957190, lvl=spdlog::level::info, fmt=...) at /root/Llama-3-8B-Instruct/bo/frameworks.ai.xengine/build/ns_model/_deps/spdlog-src/include/spdlog/logger.h:85
#18 0x00007ffe2f89351e in spdlog::logger::info<char const (&) [5], double, double> (this=0x55556d957190, fmt=...) at /root/Llama-3-8B-Instruct/bo/frameworks.ai.xengine/build/ns_model/_deps/spdlog-src/include/spdlog/logger.h:140
#19 0x00007ffe2f875aec in spdlog::info<char const (&) [5], double, double> (fmt=...) at /root/Llama-3-8B-Instruct/bo/frameworks.ai.xengine/build/ns_model/_deps/spdlog-src/include/spdlog/spdlog.h:173
#20 0x00007ffe2f83787a in ns::model_context::load (this=0x55556a81e000, model="synapsellm_executable_model/ns_Llama-3.1-8B-Instruct.bin2") at /root/Llama-3-8B-Instruct/bo/frameworks.ai.xengine/neural_speed/engine/hpu/model_hpu.hpp:720
#21 0x00007ffe2f859a74 in Model::load_model (this=0x55556a81e000, model_path="synapsellm_executable_model/ns_Llama-3.1-8B-Instruct.bin2", n_chunk=256, n_slot=256, block_size=128, n_ctx=2048, threads=4, dtype="bf16", weight_dtype="", compute_dtype="", group_size=-1, scale_dtype="", alg="", cache_path="",
parallel_type="", device_num=3) at /root/Llama-3-8B-Instruct/bo/frameworks.ai.xengine/neural_speed/engine/hpu/main_pybind_hpu.cpp:151
Could you report fmt problems in the fmt repository, spdlog can't fix it.
And since you seem to be building with Pybind I doubt it is really an fmt issue.
Can you reproduce the problem without Pybind?
Could you report fmt problems in the fmt repository, spdlog can't fix it. And since you seem to be building with Pybind I doubt it is really an fmt issue. Can you reproduce the problem without Pybind?
Thanks for your quick reply, no problem!