这个排序有问题吗? [code]
- User
这个排序有问题吗?
struct ggml_mem_buffer_info { int id; size_t size; int begin; int end; size_t offset; bool allocated; }; std::sort(buf_infos, buf_infos + n_mem_buffer, [](const ggml_mem_buffer_info & a, const ggml_mem_buffer_info & b) { return a.end - a.begin >= b.end - b.begin; }); Assistant
Yes, there is a problem with the sorting criteria.
The comparison function
([](const ggml_mem_buffer_info & a, const ggml_mem_buffer_info & b) { return a.end - a.begin >= b.end - b.begin; })sorts the structures based on the difference between their and fields. However, this difference is not necessarily a good indication of the size of the memory block.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.