Skip to content
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

[torch.compile] transparent compilation with more logging #12246

Merged
merged 8 commits into from
Jan 21, 2025

Conversation

youkaichao
Copy link
Member

@youkaichao youkaichao commented Jan 21, 2025

In preparation for torch.compile documentation, I added the following logging information:

  • which function we are compiling:
    • INFO 01-20 22:10:00 decorators.py:201] Start compiling function <code object forward at 0x7f6ea4f85580, file "/data/youkaichao/vllm/vllm/model_executor/models/llama.py", line 343>
  • how Dynamo transforms the function:
    • INFO 01-20 21:59:30 wrapper.py:101] Dynamo transformed code saved to /home/eecs/youkaichao/.cache/vllm/torch_compile_cache/bef6c83c36/rank_0/transformed_code.py
  • The computation graph (after potential splitting)
    • INFO 01-20 22:04:08 backends.py:628] Computation graph saved to /home/eecs/youkaichao/.cache/vllm/torch_compile_cache/bef6c83c36/rank_0/computation_graph.py

The following information is already available after #12182

  • Inductor compiled Python callable function
    • /home/eecs/youkaichao/.cache/vllm/torch_compile_cache/bef6c83c36/rank_0/inductor_hash_cache.py

Signed-off-by: youkaichao <[email protected]>
Signed-off-by: youkaichao <[email protected]>
Signed-off-by: youkaichao <[email protected]>
Signed-off-by: youkaichao <[email protected]>
Signed-off-by: youkaichao <[email protected]>
Copy link

👋 Hi! Thank you for contributing to the vLLM project.
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 do one of these:

  • Add ready label to the PR
  • Enable auto-merge.

🚀

Copy link
Collaborator

@heheda12345 heheda12345 left a comment

Choose a reason for hiding this comment

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

LGTM. But I think we do not need to use logger.info for the internal steps of torch.compile.

with open(graph_path, "w") as f:
f.write(src)

logger.info("Computation graph saved to %s", graph_path)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we do not need logger.info here, as most users do not need to be aware of this step. The file structure in local_cache_dir can be explained in the document.

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks for the suggestion! moved to debug instead.

with open(decompiled_file, "w") as f:
f.write(src)

logger.info("Dynamo transformed code saved to %s",
Copy link
Collaborator

Choose a reason for hiding this comment

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

The same as above.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed in fd753d1

Signed-off-by: youkaichao <[email protected]>
Signed-off-by: youkaichao <[email protected]>
Signed-off-by: youkaichao <[email protected]>
Copy link
Collaborator

@heheda12345 heheda12345 left a comment

Choose a reason for hiding this comment

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

Great job!

@youkaichao youkaichao enabled auto-merge (squash) January 21, 2025 09:30
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Jan 21, 2025
@youkaichao youkaichao disabled auto-merge January 21, 2025 11:32
@youkaichao
Copy link
Member Author

failing tests are not related (amd machine issue), merging

@youkaichao youkaichao merged commit c81081f into vllm-project:main Jan 21, 2025
49 of 58 checks passed
@youkaichao youkaichao deleted the transparent_compile branch January 21, 2025 11:33
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.

2 participants