| 113 | } |
| 114 | |
| 115 | bool Bridge::launch(int lane, int n_new, int64_t pos0, int anchor, std::string& err) { |
| 116 | Impl& I = *p_; |
| 117 | cudaSetDevice(I.device); |
| 118 | std::vector<float>& a = I.anchor[(size_t) lane]; |
| 119 | I.embed(anchor, a.data()); |
| 120 | // row 0 of the lane's block staging (the rest stays the mask row); ordered before the graph on the drafter's own stream |
| 121 | if (cudaMemcpyAsync(I.stage[(size_t) lane], a.data(), a.size() * 4, cudaMemcpyHostToDevice, I.d[(size_t) lane]->stream()) != cudaSuccess) { |
| 122 | err = "dflash2: the anchor's embedding upload"; |
| 123 | return false; |
| 124 | } |
| 125 | Dflash2Drafter& d = *I.d[(size_t) lane]; |
| 126 | return d.draft_launch(d.landing(), n_new, pos0, anchor, err); |
| 127 | } |
| 128 | |
| 129 | bool Bridge::finish(int lane, int32_t* drafts, float* probs, std::string& err) { return p_->d[(size_t) lane]->draft_finish(drafts, probs, err); } |
| 130 | void Bridge::reset(int lane) { p_->d[(size_t) lane]->reset(); } |
nothing calls this directly
no test coverage detected