The host-read tables locked in RAM as far as this machine lets the engine (memlock.hpp): the memory-lock limit raised as far as the hard limit allows, the free RAM respected, the parts locked in the order given, the rest read into memory by the same 16 threads. Never a failed start because of the lock. Returns the one log line (empty when everything is locked); it is printed here too.
| 213 | // respected, the parts locked in the order given, the rest read into memory by the same 16 threads. Never a failed start because of the lock. Returns the one log |
| 214 | // line (empty when everything is locked); it is printed here too. |
| 215 | std::string lock_tables(const std::vector<const Tensor*>& ts) { |
| 216 | std::vector<LockPart> parts; |
| 217 | uint64_t want = 0; |
| 218 | for (const Tensor* t : ts) { |
| 219 | LockPart p; |
| 220 | p.name = t->name.c_str(); |
| 221 | p.data = t->data; |
| 222 | p.nbytes = t->nbytes; |
| 223 | parts.push_back(p); |
| 224 | want += lock_page_ceil(t->nbytes) + kLockPage; |
| 225 | } |
| 226 | const LockEnv env = read_lock_env(want); |
| 227 | const LockOutcome out = lock_parts(parts, env); |
| 228 | const std::string line = lock_line(parts, out); |
| 229 | if (!line.empty()) std::fprintf(stderr, "%s\n", line.c_str()); |
| 230 | return line; |
| 231 | } |
| 232 | |
| 233 | // the stager's groups for load_card: group l every tensor of layer l, group NL the output head's. The head is read |
| 234 | // through the page cache: the draft layer (Mtp) takes its rows of output.weight from the mapping after the load |
no test coverage detected