rerope icon indicating copy to clipboard operation
rerope copied to clipboard

请问在推理阶段,为什么需要对input部份计算注意力呢?

Open Anditty opened this issue 2 years ago • 1 comments

https://github.com/bojone/rerope/blob/3710a359ae0a80aad98312c9194898fb7312dcf3/rerope_patch.py#L75C5-L75C10

请问在这段代码中,为什么在推理阶段需要对input部份计算注意力,为什么不能直接使用 if q_len == 1 中的逻辑呢?

Anditty avatar Nov 09 '23 09:11 Anditty

对于输入部分的计算(或者说第一个token的预测),我们称之为prefill,这部分需要并行计算,提高速度,所以不能按照generation的逻辑来写啊

bojone avatar May 20 '24 02:05 bojone