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

feat: Migrate GPTSession refit path in Nemo export to ModelRunner for Aligner #10654

Merged
merged 5 commits into from
Oct 2, 2024

Conversation

terrykong
Copy link
Collaborator

What does this PR do ?

Add a one line overview of what this PR aims to accomplish.

Collection: [Note which collection this PR will affect]

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)

from tensorrt_llm.lora_manager import LoraManager
from tensorrt_llm.mapping import Mapping

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'Mapping' is not used.
from tensorrt_llm.quantization import QuantMode
from tensorrt_llm.runtime import ModelConfig, ModelRunner, ModelRunnerCpp, SamplingConfig

from tensorrt_llm.runtime import GenerationSession, ModelConfig, ModelRunner, ModelRunnerCpp, SamplingConfig

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'GenerationSession' is not used.
from transformers import PreTrainedTokenizer

LOGGER = logging.getLogger("NeMo")

use_trtllm_bindings = True
try:
from tensorrt_llm.bindings import GptJsonConfig, GptSession, GptSessionConfig, KvCacheConfig, WorldConfig
from tensorrt_llm.bindings import GptJsonConfig, KvCacheConfig, WorldConfig

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'KvCacheConfig' is not used.
Import of 'WorldConfig' is not used.
nemo/export/trt_llm/tensorrt_llm_run.py Fixed Show fixed Hide fixed
@terrykong terrykong changed the title feat: Upgrade refit path in export to v12 for Aligner feat: Migrate GPTSession refit path in Nemo export to ModelRunner for Aligner Sep 27, 2024
shanmugamr1992
shanmugamr1992 previously approved these changes Oct 1, 2024
terrykong and others added 3 commits October 2, 2024 00:50
…hon runtime

Signed-off-by: Terry Kong <terryk@nvidia.com>
Signed-off-by: Terry Kong <terryk@nvidia.com>
Signed-off-by: terrykong <terrykong@users.noreply.github.com>
Signed-off-by: Terry Kong <terryk@nvidia.com>
@terrykong terrykong force-pushed the tk/v12/export-aligner-v12 branch from 3f511c9 to f3550aa Compare October 2, 2024 00:50
Signed-off-by: Terry Kong <terryk@nvidia.com>
engine_index = model_parallel_rank
mpi_rank = mpi_comm().Get_rank()
# Copied from worldConfig.h (getDevice())
mpi_device = mpi_rank % gpus_per_node

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable mpi_device is not used.
Copy link
Contributor

github-actions bot commented Oct 2, 2024

[🤖]: Hi @terrykong 👋,

I just wanted to let you know that, you know, a CICD pipeline for this PR just finished successfully ✨

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

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

Have a great day!

//cc @ko3n1g

@ko3n1g ko3n1g merged commit 99ed6db into main Oct 2, 2024
13 checks passed
@ko3n1g ko3n1g deleted the tk/v12/export-aligner-v12 branch October 2, 2024 17:43
gdengk pushed a commit to gdengk/NeMo that referenced this pull request Oct 3, 2024
… Aligner (NVIDIA#10654)

* [feat] Upgrade nemo-export path for aligner to TRTLLM-v12 and use python runtime

Signed-off-by: Terry Kong <terryk@nvidia.com>

* fix: forgot to always set _disable_torch_cuda_device_set

Signed-off-by: Terry Kong <terryk@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: terrykong <terrykong@users.noreply.github.com>
Signed-off-by: Terry Kong <terryk@nvidia.com>

* tiny cleanup

Signed-off-by: Terry Kong <terryk@nvidia.com>

---------

Signed-off-by: Terry Kong <terryk@nvidia.com>
Signed-off-by: terrykong <terrykong@users.noreply.github.com>
Co-authored-by: terrykong <terrykong@users.noreply.github.com>
Signed-off-by: Gao Deng <gdeng@nvidia.com>
gdengk pushed a commit to gdengk/NeMo that referenced this pull request Oct 3, 2024
… Aligner (NVIDIA#10654)

* [feat] Upgrade nemo-export path for aligner to TRTLLM-v12 and use python runtime

Signed-off-by: Terry Kong <terryk@nvidia.com>

* fix: forgot to always set _disable_torch_cuda_device_set

Signed-off-by: Terry Kong <terryk@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: terrykong <terrykong@users.noreply.github.com>
Signed-off-by: Terry Kong <terryk@nvidia.com>

* tiny cleanup

Signed-off-by: Terry Kong <terryk@nvidia.com>

---------

Signed-off-by: Terry Kong <terryk@nvidia.com>
Signed-off-by: terrykong <terrykong@users.noreply.github.com>
Co-authored-by: terrykong <terrykong@users.noreply.github.com>
Signed-off-by: Gao Deng <gdeng@nvidia.com>
monica-sekoyan pushed a commit that referenced this pull request Oct 14, 2024
… Aligner (#10654)

* [feat] Upgrade nemo-export path for aligner to TRTLLM-v12 and use python runtime

Signed-off-by: Terry Kong <terryk@nvidia.com>

* fix: forgot to always set _disable_torch_cuda_device_set

Signed-off-by: Terry Kong <terryk@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: terrykong <terrykong@users.noreply.github.com>
Signed-off-by: Terry Kong <terryk@nvidia.com>

* tiny cleanup

Signed-off-by: Terry Kong <terryk@nvidia.com>

---------

Signed-off-by: Terry Kong <terryk@nvidia.com>
Signed-off-by: terrykong <terrykong@users.noreply.github.com>
Co-authored-by: terrykong <terrykong@users.noreply.github.com>
hainan-xv pushed a commit to hainan-xv/NeMo that referenced this pull request Nov 5, 2024
… Aligner (NVIDIA#10654)

* [feat] Upgrade nemo-export path for aligner to TRTLLM-v12 and use python runtime

Signed-off-by: Terry Kong <terryk@nvidia.com>

* fix: forgot to always set _disable_torch_cuda_device_set

Signed-off-by: Terry Kong <terryk@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: terrykong <terrykong@users.noreply.github.com>
Signed-off-by: Terry Kong <terryk@nvidia.com>

* tiny cleanup

Signed-off-by: Terry Kong <terryk@nvidia.com>

---------

Signed-off-by: Terry Kong <terryk@nvidia.com>
Signed-off-by: terrykong <terrykong@users.noreply.github.com>
Co-authored-by: terrykong <terrykong@users.noreply.github.com>
Signed-off-by: Hainan Xu <hainanx@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