| 446 | } |
| 447 | |
| 448 | Server(const Args& args, fnx::Model& model, fnx::Engine& eng, Input& input) : a(args), m(model), e(eng), in(input) { |
| 449 | cache = std::make_shared<fnx::ConvCache>(); |
| 450 | cache->budget = (size_t) a.cache_mib << 20; |
| 451 | slots.resize((size_t) a.batch); |
| 452 | slots[0].lane = 0; |
| 453 | slots[0].sess = std::make_unique<fnx::Session>(e, a.K, a.lookup, EOS, 248045, cache, 0); |
| 454 | // every lane and every window graph now: what they take, taken before the first request |
| 455 | for (int i = 1; i < a.batch; ++i) lane_for(i); |
| 456 | if (a.batch > 1 && fnx::batch_drafts() != fnx::BatchDrafts::off) |
| 457 | dec = std::make_unique<fnx::BatchDecoder>(e, a.K, a.lookup, EOS, fnx::batch_drafts()); |
| 458 | e.warm_graphs(); |
| 459 | } |
| 460 | |
| 461 | // the slot's lane and session, made on first use (lane 0 is slot 0's from the start, but lanes move between |
| 462 | // slots, so any slot may be the one without; a new lane takes pool pages) |