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

[BUG] The batch_manage.a choice error in --cpp-only when torch's cxx_abi version is different with gcc #151

Closed
thisjiang opened this issue Oct 27, 2023 · 3 comments
Assignees
Labels
triaged Issue has been triaged by maintainers

Comments

@thisjiang
Copy link

Bug Report

The cpp benchmark will compile error when

  1. torch is compiled with cxx11 abi = 0: check by python -c "import torch; print(torch.compiled_with_cxx11_abi(),end='');"
  2. gcc default cxx11 abi = 1 : check by echo '#include <string>' | g++ -x c++ -E -dM - | fgrep _GLIBCXX_USE_CXX11_ABI
  3. trt-llm was compile with --cpp-only
企业微信截图_0fbb8ea9-27de-4afc-947c-7baf631e4808

Bug Reason

The bug was caused by:

  1. In cpp/tensorrt_llm/CMakeLists.txt#L63, the BATCH_MANAGER_TARGET is only choice by check torch's cxx11 abi version.
  2. But if set --cpp-only, the cmake option BUILD_PYT will be False, that means, the code of add_compile_options(${TORCH_CXX_FLAGS}) in cpp/CMakeLists.txt#L284 will not run, in other word, the trt-llm will compile with the gcc's default cxx11 abi version.

In a word, the trt-llm is compile by gcc's default cxx11 abi version, but the batch_manage.a is choiced by pytorch's cxx11 abi version when trt-llm was compiled by --cpp-only.

@juney-nvidia
Copy link
Collaborator

juney-nvidia commented Oct 28, 2023

@thisjiang thanks for reporting this. But sorry for that I didn't get the full point here.
When the batch_manager.a is packaged, we do taken the C++11 compatibility into consideration. If you have any issue with it, can you share the concrete steps of re-producing the issue in your environment? Also pls share your GPU device, and CUDA/OS version.

Thanks
June

@juney-nvidia juney-nvidia self-assigned this Oct 28, 2023
@juney-nvidia juney-nvidia added the triaged Issue has been triaged by maintainers label Oct 28, 2023
@Shixiaowei02
Copy link
Collaborator

I think @thisjiang is referring to the fact that we don't check the type of abi under certain compilation options. We will fix it.

@Shixiaowei02
Copy link
Collaborator

The bug has been fixed in the main branch, thanks for the support. I will close this issue. If you have any questions, please open it and continue the discussion. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged Issue has been triaged by maintainers
Projects
None yet
Development

No branches or pull requests

4 participants
@thisjiang @Shixiaowei02 @juney-nvidia and others