Repository navigation
Support InternLM models (deprecated and move to #266) - #123
wangruohui wants to merge 22 commits into
Conversation
|
Thanks a lot @wangruohui - is there a way we can help you? Or, should we just wait for your PR to be ready and take it to integrate into our internal repo, then push the changes? |
|
Hello @jdemouth-nvidia , thanks for your help. I can first go through features that already covered in examples and will reach for your help on difficulties. |
|
Perfect! Thanks a lot! |
add internlm in quant support table
|
Hi @jdemouth-nvidia , I think I have finished basic parts on both variant of InternLM, namely the 7B and the 20B model, and updated the docs covering this part, including:
Something left including:
|
|
Hi @wangruohui , Thanks so much for that amazing contribution! We really appreciate. We will ask an engineer from our team to start the integration into our internal repo and validate that the model works as expected. We will keep you posted and we will publish it as soon as it’s ready (and, of course, credit you for the work). Does that work for you? Thanks, |
|
As Julien mentioned above, we are happy to integrate your great work into our internal repo and then publish to this github repo. I think we don't need to add full feature support for the InternLM model for now and can firstly integrate the existing implementation as the beginning. If you think the current MR is ready enough based on your local validation, then we can start the integration work. Waiting for your feedback. Thanks |
|
Hi @jdemouth-nvidia and @juney-nvidia , Sure, you can start to integrate the codes based on your workflow and test them. Features mentioned above works well based on my local test. And if some feature (like FP8) directly works on your test infra without modifying current codes, you can also uncomment corresponding lines in the README. BTW, I would like to know some detail on the workflow. It sounds that you will not directly work on Github but merge the code in your internal repo and finally publish them back on Github in some future release? If so, will this PR finally appears, e.g. as one squashed commit, in the commit history? |
|
Our workflow is the following one: We have an internal repo in which we develop TensorRT-LLM. It’s our reference code. When PR are made on our public GitHub, we will integrate the code into our internal repository and push the updated code to the public repo in the future. It has not been decided yet if your PR will be translated into a single commit squashed with other code changes (from us or from other PRs) or if we will have an explicit commit dedicated to your work in the main branch. I guess the latter would be better for you. Is that right? We value your work and want to make it clear that you made the contribution. So, we have to find the best way and feedback is welcome. |
|
Hi @jdemouth-nvidia , Either git workflow is good for me. Just hoping myself would finally appears in the git commit history as a proof of my work. Thank you! |
|
I’ll discuss with the rest of the team but we might be able to come up with something to have you appear in the commit history. We’ll get back to you with a proposal. I want proper credit to go where it is due. It’s very important to us. |
|
Hi @wangruohui , I've verified your PR on H100/A100 w/ per README.md instructions.
Thanks, |
|
Hi @nv-guomingz ,
The drop of rouge number seems to be large especially for 7B model in per-tensor mode. I tried different sq parameters and
Rouge number on 20B models also gain with
But as comparison, I also tested llama following its readme. It seems the drop is even larger.
|
Yes.
It's OK for me to accept modifications that improve code quality. But I think |
|
thanks @wangruohui for updating. However, I can't reproduce your results locally. Below is my results with your latest commit(f2aaeef)
I'll update intenlm 20b data later. May I know your env config detalis, like device/cuda version,etc. For llama accuracy issue, thanks for reporting. We'll have a look later. |
|
I noticed that the Rouge score of your HuggingFace model is also lower than mine. I use A100 and CUDA 12.2. The software stack is based on docker provided in the doc + pip install -r requirements.txt from internlm example. The model is from https://huggingface.co/internlm/internlm-chat-7b , with latest commit Other Huggingface related pip modules: Full list of Commands to run for per-tensor tensor mode: Summaries generated by trt and by hf |
|
Yes, the model I was testing earlier is not internlm-chat-7b but internlm-7b. After switch to internlm-chat-7b, I remeasured the sq accuracy again and got below data: - H100/internlm-chat-7b/pet tensor/sq 0.5 - A100/internlm-chat-7b/pet channel + per token/sq 0.5 It seems that for int8 sq results, I still can't reproduce your results and now we're align on hf scores. All those above scores are measured with same pip modules |
|
And I noticed that this PR's target is 0.5.0 branch, could u please refresh this PR and set its target to main branch? And let's remeasure the int8 acc after pr updated. |
|
Hello @nv-guomingz , It seems release-0.5.0 and main diverge somewhere before my commits and directly changing the target of this PR cause lots of conflicts but irrelevant to InternLM. To make things easier, I create another branch with commits rebased onto main https://github.com/wangruohui/TensorRT-LLM/tree/internlm-main. If tests pass, I can create another PR or just force push to this one. Moreover I noticed that some |
Ok, I'll take a look on new branch. I did recompile completely when I switch to new hw platform(h100->a100, or vice versa). |
|
I made some update to compatible with main branch and recompile, the rouge number becomes a little bit different, but at same level. Shown as below. As quantization usually decreases accuracies, I think the result is acceptable.
It seems from your result that score on H100 is good but suboptimal on A100. But I am a little bit curious about the difference. Since int8 weights are computed from python side and stored to file system prior to engine building. This means that different GPU builds the engine using the same set of int8 weight. Then the built engine on different GPU model should not differ a lot but the rouge number on A100 is much lower than that on H100 based on your result. Do you have any idea on this? |
|
Hi @wangruohui I re-measured your latest branch and got the identical acc results.
It means we can reproduce your work at our side finally. As we discussed above, let's merge your PR firstly to make sure credit you for the work. And we may make further optimization/code refactor base on your initial commit later. Is that ok for you? If so, I suggest we can start merge process internally now. Finally, thank you for your great contribution. Thanks, |
Yes, it doesn't make sense that different hw platform generated different acc/scores, we'll take a look it. |
Happy to hear that. Please move on and make sure to use the updated branch. Do I need to create another PR with the new branch? |
Yes, please file a clean MR. |
|
Here you are #266 . |
|
Close this one since we've merged #266 |


This is an on-going work to support InternLM models in TRL-LLM.
As InternLM shares some similarity with llama, codes provided here is mainly based on
examples/llamaandtensorrt_llm/models/llama, with automatic renaming and specific modification to difference on model structures, chat template etc.Currently based on my test, simply building / inferencing FP16/BF16 on single GPU works and the output (of FP16 engines) is aligned with HuggingFace version. But tensor/pipeline parallelism and quantization are remained undeveloped and untested.
I have commented out docs of undeveloped part and would unlocking progressively.