Skip to content

Disable the torch.compile cache checks when VLLM_DISABLE_COMPILE_CACHE=1 #16573

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

Merged
merged 2 commits into from
Apr 26, 2025

Conversation

houseroad
Copy link
Collaborator

@houseroad houseroad commented Apr 14, 2025

Disable the checks if it's not used.

Run the benchmark script to test

VLLM_USE_V1=1; with-proxy python3 benchmarks/benchmark_latency.py --model "meta-llama/Meta-Llama-3.1-70B" --tensor-parallel-size 8 --trust-remote-code --enable-chunked-prefill --disable-log-stats --gpu-memory-utilization=0.7

Output

Avg latency: 3.45998974510779 seconds
10% percentile latency: 3.2058258310426027 seconds
25% percentile latency: 3.2742707084398717 seconds
50% percentile latency: 3.4767037329729646 seconds
75% percentile latency: 3.6269146820995957 seconds
90% percentile latency: 3.6901761000510307 seconds

Copy link

👋 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 fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

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 ready label to the PR or enable auto-merge.

🚀

@facebook-github-bot
Copy link

This pull request was exported from Phabricator. Differential Revision: D72945995

@houseroad houseroad changed the title Enable Llama4 available in fbcode vllm Disable the torch.compile cache checks when VLLM_DISABLE_COMPILE_CACHE=1 Apr 14, 2025
@facebook-github-bot
Copy link

This pull request was exported from Phabricator. Differential Revision: D72945995

1 similar comment
@facebook-github-bot
Copy link

This pull request was exported from Phabricator. Differential Revision: D72945995

Copy link
Member

@youkaichao youkaichao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +300 to +319
if not envs.VLLM_DISABLE_COMPILE_CACHE:
assert hash_str is not None, (
"failed to get the hash of the compiled graph")
assert file_path is not None, (
"failed to get the file path of the compiled graph")
Copy link
Collaborator

@zou3519 zou3519 Apr 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mentioned this to @houseroad offline, but the implication here is:

  • if hash_str is None and envs.VLLM_DISABLE_COMPILE_CACHE is True, then this implies that the vLLM monkey-patched hijack_compiled_fx_graph_hash never ran
  • if hijack_compiled_fx_graph_hash never ran, but compile_fx produced a graph, then this implies that we are actually relying on torch.compile's caching logic!

The overall inference is that when VLLM_DISABLE_COMPILE_CACHE is on, we can be relying on torch.compile's cache. This doesn't seem right to me (or at least it is confusing).

I think the right fix is something like disabling the remote caches (#16611) so we don't get into this state.

Thoughts, @youkaichao? I'm also happy to document this behavior and ship this PR as-is but I will potentially dig it out later in the standalone_compile refactor.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the right fix is something like disabling the remote caches (#16611) so we don't get into this state.

agree, let's disable remote cache then.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I agree with the above point, #16611 is the right solution. I think it still makes sense to add this change, my point is that we should have some overall switch to disable all the logic related to torch compile cache, which is VLLM_DISABLE_COMPILE_CACHE.

For some internal use case, with VLLM_DISABLE_COMPILE_CACHE=1, we still fail on the compile cache related checks, which doesn't really make sense to me.

@houseroad houseroad added the ready ONLY add when PR is ready to merge/full CI is needed label Apr 25, 2025
houseroad and others added 2 commits April 25, 2025 15:01
Summary:
Pull Request resolved: vllm-project#16573

Enable Llama4 in the fbcode vllm.

Reviewed By: henryoier

Differential Revision: D72945995

Signed-off-by: Lu Fang <[email protected]>
Signed-off-by: Lu Fang <[email protected]>
@houseroad houseroad merged commit 4d17e20 into vllm-project:main Apr 26, 2025
43 checks passed
jikunshang pushed a commit to jikunshang/vllm that referenced this pull request Apr 29, 2025
lk-chen pushed a commit to lk-chen/vllm that referenced this pull request Apr 29, 2025
adobrzyn pushed a commit to HabanaAI/vllm-fork that referenced this pull request Apr 30, 2025
RichardoMrMu pushed a commit to RichardoMrMu/vllm that referenced this pull request May 12, 2025
zzzyq pushed a commit to zzzyq/vllm that referenced this pull request May 24, 2025
minpeter pushed a commit to minpeter/vllm that referenced this pull request Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready ONLY add when PR is ready to merge/full CI is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants