Skip to content

Autodetect dtype on exporting to TensorRT-LLM#11907

Merged
oyilmaz-nvidia merged 13 commits intomainfrom
jlasek/nim_s01_e03
Jan 23, 2025
Merged

Autodetect dtype on exporting to TensorRT-LLM#11907
oyilmaz-nvidia merged 13 commits intomainfrom
jlasek/nim_s01_e03

Conversation

@janekl
Copy link
Collaborator

@janekl janekl commented Jan 21, 2025

What does this PR do ?

Autodetect dtype parameter -- model weights data type -- on exporting to TensorRT-LLM.

Collection: NLP / LLM

Changelog

  • Add specific line by line info of high level changes in this PR.

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this 

GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

If you haven't finished some of the above items you can still open "Draft" PR.

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

  • Related to # (issue)

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
This reverts commit b3c2db0.

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
@janekl janekl requested a review from oyilmaz-nvidia January 21, 2025 13:02
@oyilmaz-nvidia oyilmaz-nvidia enabled auto-merge (squash) January 21, 2025 17:33
oyilmaz-nvidia
oyilmaz-nvidia previously approved these changes Jan 21, 2025
Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
@janekl janekl added Run CICD and removed Run CICD labels Jan 22, 2025
Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
@janekl janekl force-pushed the jlasek/nim_s01_e03 branch from 82e4656 to 92eb3c6 Compare January 22, 2025 13:46
@janekl janekl added Run CICD and removed Run CICD labels Jan 22, 2025
Signed-off-by: janekl <janekl@users.noreply.github.com>
@github-actions
Copy link
Contributor

[🤖]: Hi @janekl 👋,

We wanted to let you know that a CICD pipeline for this PR just finished successfully

So it might be time to merge this PR or get some approvals

I'm just a bot so I'll leave it you what to do next.

//cc @pablo-garay @ko3n1g

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
@janekl janekl added Run CICD and removed Run CICD labels Jan 22, 2025
@github-actions
Copy link
Contributor

beep boop 🤖: 🙏 The following files have warnings. In case you are familiar with these, please try helping us to improve the code base.


Your code was analyzed with PyLint. The following annotations have been identified:

************* Module nemo.export.trt_llm.converter.model_to_trt_llm_ckpt
nemo/export/trt_llm/converter/model_to_trt_llm_ckpt.py:39:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/converter/model_to_trt_llm_ckpt.py:45:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/converter/model_to_trt_llm_ckpt.py:53:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/converter/model_to_trt_llm_ckpt.py:70:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/converter/model_to_trt_llm_ckpt.py:85:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/converter/model_to_trt_llm_ckpt.py:95:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/converter/model_to_trt_llm_ckpt.py:99:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/converter/model_to_trt_llm_ckpt.py:114:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/converter/model_to_trt_llm_ckpt.py:278:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/converter/model_to_trt_llm_ckpt.py:285:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/converter/model_to_trt_llm_ckpt.py:292:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/converter/model_to_trt_llm_ckpt.py:493:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module nemo.export.trt_llm.nemo_ckpt_loader.nemo_file
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:51:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:165:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:197:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:208:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:212:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:239:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:250:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:271:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:366:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:536:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:623:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:627:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:638:0: C0115: Missing class docstring (missing-class-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:650:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:690:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:727:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:740:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/export/trt_llm/nemo_ckpt_loader/nemo_file.py:25:0: W0611: Unused import tensorstore (unused-import)

-----------------------------------
Your code has been rated at 9.78/10

Mitigation guide:

  • Add sensible and useful docstrings to functions and methods
  • For trivial methods like getter/setters, consider adding # pylint: disable=C0116 inside the function itself
  • To disable multiple functions/methods at once, put a # pylint: disable=C0116 before the first and a # pylint: enable=C0116 after the last.

By applying these rules, we reduce the occurance of this message in future.

Thank you for improving NeMo's documentation!

@github-actions
Copy link
Contributor

[🤖]: Hi @janekl 👋,

We wanted to let you know that a CICD pipeline for this PR just finished successfully

So it might be time to merge this PR or get some approvals

I'm just a bot so I'll leave it you what to do next.

//cc @pablo-garay @ko3n1g

@oyilmaz-nvidia oyilmaz-nvidia merged commit 116b5cd into main Jan 23, 2025
@oyilmaz-nvidia oyilmaz-nvidia deleted the jlasek/nim_s01_e03 branch January 23, 2025 11:17
parthmannan pushed a commit that referenced this pull request Jan 28, 2025
* Autodetect dtype from NeMo checkpoint for TRT-LLM export

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>

* Attempting parallel build

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>

* Revert "Attempting parallel build"

This reverts commit b3c2db0.

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>

* Update logs and error messages

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>

* Try autodetecting dtype parameter by default

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>

---------

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
Co-authored-by: Onur Yilmaz <35306097+oyilmaz-nvidia@users.noreply.github.com>
Signed-off-by: Parth Mannan <pmannan@nvidia.com>
abhinavg4 pushed a commit that referenced this pull request Jan 30, 2025
* Autodetect dtype from NeMo checkpoint for TRT-LLM export

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>

* Attempting parallel build

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>

* Revert "Attempting parallel build"

This reverts commit b3c2db0.

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>

* Update logs and error messages

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>

* Try autodetecting dtype parameter by default

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>

---------

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
Co-authored-by: Onur Yilmaz <35306097+oyilmaz-nvidia@users.noreply.github.com>
Signed-off-by: Abhinav Garg <abhgarg@nvidia.com>
youngeunkwon0405 pushed a commit to youngeunkwon0405/NeMo that referenced this pull request Feb 10, 2025
* Autodetect dtype from NeMo checkpoint for TRT-LLM export

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>

* Attempting parallel build

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>

* Revert "Attempting parallel build"

This reverts commit b3c2db0.

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>

* Update logs and error messages

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>

* Try autodetecting dtype parameter by default

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>

---------

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
Co-authored-by: Onur Yilmaz <35306097+oyilmaz-nvidia@users.noreply.github.com>
Signed-off-by: Youngeun Kwon <youngeunk@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants