Simplify candidates sorting

This commit is contained in:
Ed Addario 2025-09-22 20:11:54 +01:00
parent d79ade2e8e
commit 7ba6001ec8
No known key found for this signature in database
GPG Key ID: E7875815A3230993
1 changed files with 4 additions and 0 deletions

View File

@ -1209,6 +1209,10 @@ static std::unordered_map<std::string, ggml_type> target_bpw_type(
if (a.bytes != b.bytes) { return a.bytes < b.bytes; }
return a.error < b.error;
});
const auto last = std::unique(candidates.begin(), candidates.end(), [](const candidate_types & a, const candidate_types & b) {
return a.bytes == b.bytes;
});
candidates.erase(last, candidates.end());
// Pareto by bytes -> error
std::vector<candidate_types> pareto;