-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
[Bugfix] Avoid repeatedly creating dummy data during engine startup #17935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add 🚀 |
Signed-off-by: DarkLight1337 <[email protected]>
6265eaa
to
7d0557c
Compare
Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]>
I'm actually not seeing the speedup from this PR with the following test script # python3 test.py --model Qwen/Qwen2.5-VL-3B-Instruct
# test.py
from vllm.multimodal import MULTIMODAL_REGISTRY
from vllm.engine.async_llm_engine import AsyncEngineArgs
from vllm.engine.async_llm_engine import UsageContext
from vllm.utils import FlexibleArgumentParser
from vllm.v1.core.encoder_cache_manager import compute_encoder_budget
import time
if __name__ == "__main__":
parser = FlexibleArgumentParser()
parser = AsyncEngineArgs.add_cli_args(parser)
args = parser.parse_args()
engine_args = AsyncEngineArgs.from_cli_args(args)
vllm_config = engine_args.create_engine_config(UsageContext.ENGINE_CONTEXT)
start_time = time.perf_counter()
encoder_compute_budget, encoder_cache_size = compute_encoder_budget(
model_config=vllm_config.model_config,
scheduler_config=vllm_config.scheduler_config,
mm_registry=MULTIMODAL_REGISTRY,
)
print(f"Time taken: {time.perf_counter() - start_time}") On main
This branch
|
The cache is only effective if you run |
In actual inference this means that the multi-modal data used in dummy run is cached (since it's called after |
OK it seems that I do need to implement the async version of this method... |
Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]>
…llm-project#17935) Signed-off-by: DarkLight1337 <[email protected]>
…llm-project#17935) Signed-off-by: DarkLight1337 <[email protected]> Signed-off-by: Chenheli Hua <[email protected]>
This PR fixes an issue where the startup time of multimodal models is multipled because dummy data is created multiple times during profile run and graph capturing. Instead of disabling cache when dummy data is generated, the cache is now always enabled. To conserve memory, the cache is instead cleared at the end of the engine start process.
Cache reset code is taken from #16478