We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b460d16 commit 87d34b3Copy full SHA for 87d34b3
tools/server/server.cpp
@@ -2142,15 +2142,16 @@ struct server_context {
2142
2143
// find the slot that has been least recently used
2144
if (ret == nullptr) {
2145
- int64_t t_last = ggml_time_us();
+ int64_t t_last = -1;
2146
+
2147
for (server_slot & slot : slots) {
2148
// skip the slot if it is not available
2149
if (slot.is_processing()) {
2150
continue;
2151
}
2152
2153
// select the current slot if the criteria match
- if (slot.t_last_used < t_last) {
2154
+ if (!ret || slot.t_last_used <= t_last) {
2155
t_last = slot.t_last_used;
2156
ret = &slot;
2157
0 commit comments