Skip to content

Commit 7ba6001

Browse files
committed
Simplify candidates sorting
1 parent d79ade2 commit 7ba6001

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/llama-quant.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,6 +1209,10 @@ static std::unordered_map<std::string, ggml_type> target_bpw_type(
12091209
if (a.bytes != b.bytes) { return a.bytes < b.bytes; }
12101210
return a.error < b.error;
12111211
});
1212+
const auto last = std::unique(candidates.begin(), candidates.end(), [](const candidate_types & a, const candidate_types & b) {
1213+
return a.bytes == b.bytes;
1214+
});
1215+
candidates.erase(last, candidates.end());
12121216

12131217
// Pareto by bytes -> error
12141218
std::vector<candidate_types> pareto;

0 commit comments

Comments
 (0)