| 38 | } // namespace |
| 39 | |
| 40 | void BatchLane::start(int lane_, const Sampling& s_, const std::mt19937_64& rng_, std::vector<int> ctx_) { |
| 41 | if (ctx_.empty()) throw std::runtime_error("batch lane: no next token"); |
| 42 | lane = lane_; |
| 43 | s = s_; |
| 44 | rng = rng_; |
| 45 | ctx = std::move(ctx_); |
| 46 | drafts.clear(); |
| 47 | qs.clear(); |
| 48 | chain = false; |
| 49 | chains = 0; |
| 50 | shadow = -1; |
| 51 | shadow_q = Dist{}; |
| 52 | idle = 0; |
| 53 | tried.assign(MAXT, 1.0); |
| 54 | stood.assign(MAXT, CHAIN_PRIOR); |
| 55 | lk_tried.assign(MAXT, 1.0); |
| 56 | lk_stood.assign(MAXT, LOOKUP_PRIOR); |
| 57 | offered = accepted = 0; |
| 58 | } |
| 59 | |
| 60 | void BatchLane::cut(int rows) { |
| 61 | const size_t d = (size_t) std::max(0, rows - 1); |