Skip to content

Export & deploy updates (part I)#10941

Merged
oyilmaz-nvidia merged 14 commits intomainfrom
jlasek/vllm_extra
Oct 29, 2024
Merged

Export & deploy updates (part I)#10941
oyilmaz-nvidia merged 14 commits intomainfrom
jlasek/vllm_extra

Conversation

@janekl
Copy link
Collaborator

@janekl janekl commented Oct 18, 2024

What does this PR do ?

Extra changes just for cleanup purposes related to #10904, isolated here to facilitate review for main functionalities.

Collection: NLP

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>
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>
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: janekl <janekl@users.noreply.github.com>
output_deployed = output_deployed["sentences"]
# MegatronLLMDeployable will return the prompt + generated output, so cut off the prompt
for i, output in enumerate(output_deployed):
output = output[len(prompts[i]) :]

Check notice

Code scanning / CodeQL

Unused local variable

Variable output is not used.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is indeed an issue: cutting off is not really done here. Fixed in 093aa94

This reverts commit 8499d50.

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
)
return exporter
except Exception as error:
raise RuntimeError("An error has occurred during the model export. Error message: " + str(error))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggestion: just propagate the original exception (hence removing try / catch block)

args.test_deployment = str_to_bool("test_deployment", args.test_deployment)
args.functional_test = str_to_bool("functional_test", args.functional_test)
args.save_trt_engine = str_to_bool("save_trt_engin", args.save_trt_engine)
args.save_engine = str_to_bool("save_engine", args.save_engine)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Renamed as this flag is for both TRT-LLM and vLLM engines.

use_embedding_sharing = False

if trt_llm_export_kwargs is None:
trt_llm_export_kwargs = {}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not needed here

janekl and others added 2 commits October 29, 2024 10:15
Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
Signed-off-by: janekl <janekl@users.noreply.github.com>
# MegatronLLMDeployable will return the prompt + generated output, so cut off the prompt
for i, output in enumerate(output_deployed):
output = output[len(prompts[i]) :]
output_deployed[i, :] = output[0][len(prompts[i]) :]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Explained here #10941 (comment)

@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 a8832b8 into main Oct 29, 2024
@oyilmaz-nvidia oyilmaz-nvidia deleted the jlasek/vllm_extra branch October 29, 2024 17:01
hainan-xv pushed a commit to hainan-xv/NeMo that referenced this pull request Nov 5, 2024
* Update vLLMExporter docstring

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

* No need to create empty kwargs here

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

* Use debug from command line

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

* Param save_engine for both both vLLM and TRT-LLM

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

* Unused backend param in run_trt_llm_inference

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

* Reindent files for non-existent checkpoint check

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

* Docs for lora_checkpoints

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

* Improve config readability

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

* Raise error directly in get_vllm_deployable

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

* Apply isort and black reformatting

Signed-off-by: janekl <janekl@users.noreply.github.com>

* Revert "Reindent files for non-existent checkpoint check"

This reverts commit 8499d50.

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

* Cut off prompt for real

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

* Apply isort and black reformatting

Signed-off-by: janekl <janekl@users.noreply.github.com>

---------

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
Signed-off-by: janekl <janekl@users.noreply.github.com>
Co-authored-by: janekl <janekl@users.noreply.github.com>
Signed-off-by: Hainan Xu <hainanx@nvidia.com>
lilyw97 pushed a commit to lilyw97/NeMo that referenced this pull request Nov 13, 2024
* Update vLLMExporter docstring

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

* No need to create empty kwargs here

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

* Use debug from command line

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

* Param save_engine for both both vLLM and TRT-LLM

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

* Unused backend param in run_trt_llm_inference

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

* Reindent files for non-existent checkpoint check

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

* Docs for lora_checkpoints

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

* Improve config readability

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

* Raise error directly in get_vllm_deployable

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

* Apply isort and black reformatting

Signed-off-by: janekl <janekl@users.noreply.github.com>

* Revert "Reindent files for non-existent checkpoint check"

This reverts commit 8499d50.

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

* Cut off prompt for real

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

* Apply isort and black reformatting

Signed-off-by: janekl <janekl@users.noreply.github.com>

---------

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
Signed-off-by: janekl <janekl@users.noreply.github.com>
Co-authored-by: janekl <janekl@users.noreply.github.com>
HuiyingLi pushed a commit to HuiyingLi/NeMo that referenced this pull request Nov 15, 2024
* Update vLLMExporter docstring

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

* No need to create empty kwargs here

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

* Use debug from command line

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

* Param save_engine for both both vLLM and TRT-LLM

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

* Unused backend param in run_trt_llm_inference

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

* Reindent files for non-existent checkpoint check

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

* Docs for lora_checkpoints

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

* Improve config readability

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

* Raise error directly in get_vllm_deployable

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

* Apply isort and black reformatting

Signed-off-by: janekl <janekl@users.noreply.github.com>

* Revert "Reindent files for non-existent checkpoint check"

This reverts commit 8499d50.

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

* Cut off prompt for real

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

* Apply isort and black reformatting

Signed-off-by: janekl <janekl@users.noreply.github.com>

---------

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
Signed-off-by: janekl <janekl@users.noreply.github.com>
Co-authored-by: janekl <janekl@users.noreply.github.com>
XuesongYang pushed a commit to paarthneekhara/NeMo that referenced this pull request Jan 18, 2025
* Update vLLMExporter docstring

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

* No need to create empty kwargs here

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

* Use debug from command line

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

* Param save_engine for both both vLLM and TRT-LLM

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

* Unused backend param in run_trt_llm_inference

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

* Reindent files for non-existent checkpoint check

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

* Docs for lora_checkpoints

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

* Improve config readability

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

* Raise error directly in get_vllm_deployable

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

* Apply isort and black reformatting

Signed-off-by: janekl <janekl@users.noreply.github.com>

* Revert "Reindent files for non-existent checkpoint check"

This reverts commit 8499d50.

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

* Cut off prompt for real

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

* Apply isort and black reformatting

Signed-off-by: janekl <janekl@users.noreply.github.com>

---------

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
Signed-off-by: janekl <janekl@users.noreply.github.com>
Co-authored-by: janekl <janekl@users.noreply.github.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.

2 participants