InternLM / InternLM/lmdeploy

[Feature] Reuse the text prompt encoding when processing batch jobs

Open
#2,380 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
8.1k
Forks
748
Avg merge
6d 2h
Merged PRs (30d)
54

Description

### Motivation

我们想用InternVL2 做一些图像上的批处理工作。所有图片用到的prompt 是一样的。Prompt 比较长,有可观的耗时。
用pipeline batch_infer 的时候每次都要重新计算一遍text prompt。有什么方法可以避免重复的在text promt独立的计算, 只计算后续图片的embedding 吗?

### Related resources

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.