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

Export & deploy updates (part I) #10941

Merged
merged 14 commits into from
Oct 29, 2024
Merged

Export & deploy updates (part I) #10941

merged 14 commits into from
Oct 29, 2024

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)

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 Note test

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

)
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)

@@ -811,7 +808,7 @@ def str_to_bool(name: str, s: str, optional: bool = False) -> Optional[bool]:
args.test_cpp_runtime = str_to_bool("test_cpp_runtime", args.test_cpp_runtime)
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.

@@ -497,9 +497,6 @@ def run_existing_checkpoints(
else:
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
@@ -591,7 +588,7 @@ def run_in_framework_inference(
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]) :]
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)

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
156 of 158 checks passed
@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 <[email protected]>

* No need to create empty kwargs here

Signed-off-by: Jan Lasek <[email protected]>

* Use debug from command line

Signed-off-by: Jan Lasek <[email protected]>

* Param save_engine for both both vLLM and TRT-LLM

Signed-off-by: Jan Lasek <[email protected]>

* Unused backend param in run_trt_llm_inference

Signed-off-by: Jan Lasek <[email protected]>

* Reindent files for non-existent checkpoint check

Signed-off-by: Jan Lasek <[email protected]>

* Docs for lora_checkpoints

Signed-off-by: Jan Lasek <[email protected]>

* Improve config readability

Signed-off-by: Jan Lasek <[email protected]>

* Raise error directly in get_vllm_deployable

Signed-off-by: Jan Lasek <[email protected]>

* Apply isort and black reformatting

Signed-off-by: janekl <[email protected]>

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

This reverts commit 8499d50.

Signed-off-by: Jan Lasek <[email protected]>

* Cut off prompt for real

Signed-off-by: Jan Lasek <[email protected]>

* Apply isort and black reformatting

Signed-off-by: janekl <[email protected]>

---------

Signed-off-by: Jan Lasek <[email protected]>
Signed-off-by: janekl <[email protected]>
Co-authored-by: janekl <[email protected]>
Signed-off-by: Hainan Xu <[email protected]>
lilyw97 pushed a commit to lilyw97/NeMo that referenced this pull request Nov 13, 2024
* Update vLLMExporter docstring

Signed-off-by: Jan Lasek <[email protected]>

* No need to create empty kwargs here

Signed-off-by: Jan Lasek <[email protected]>

* Use debug from command line

Signed-off-by: Jan Lasek <[email protected]>

* Param save_engine for both both vLLM and TRT-LLM

Signed-off-by: Jan Lasek <[email protected]>

* Unused backend param in run_trt_llm_inference

Signed-off-by: Jan Lasek <[email protected]>

* Reindent files for non-existent checkpoint check

Signed-off-by: Jan Lasek <[email protected]>

* Docs for lora_checkpoints

Signed-off-by: Jan Lasek <[email protected]>

* Improve config readability

Signed-off-by: Jan Lasek <[email protected]>

* Raise error directly in get_vllm_deployable

Signed-off-by: Jan Lasek <[email protected]>

* Apply isort and black reformatting

Signed-off-by: janekl <[email protected]>

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

This reverts commit 8499d50.

Signed-off-by: Jan Lasek <[email protected]>

* Cut off prompt for real

Signed-off-by: Jan Lasek <[email protected]>

* Apply isort and black reformatting

Signed-off-by: janekl <[email protected]>

---------

Signed-off-by: Jan Lasek <[email protected]>
Signed-off-by: janekl <[email protected]>
Co-authored-by: janekl <[email protected]>
HuiyingLi pushed a commit to HuiyingLi/NeMo that referenced this pull request Nov 15, 2024
* Update vLLMExporter docstring

Signed-off-by: Jan Lasek <[email protected]>

* No need to create empty kwargs here

Signed-off-by: Jan Lasek <[email protected]>

* Use debug from command line

Signed-off-by: Jan Lasek <[email protected]>

* Param save_engine for both both vLLM and TRT-LLM

Signed-off-by: Jan Lasek <[email protected]>

* Unused backend param in run_trt_llm_inference

Signed-off-by: Jan Lasek <[email protected]>

* Reindent files for non-existent checkpoint check

Signed-off-by: Jan Lasek <[email protected]>

* Docs for lora_checkpoints

Signed-off-by: Jan Lasek <[email protected]>

* Improve config readability

Signed-off-by: Jan Lasek <[email protected]>

* Raise error directly in get_vllm_deployable

Signed-off-by: Jan Lasek <[email protected]>

* Apply isort and black reformatting

Signed-off-by: janekl <[email protected]>

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

This reverts commit 8499d50.

Signed-off-by: Jan Lasek <[email protected]>

* Cut off prompt for real

Signed-off-by: Jan Lasek <[email protected]>

* Apply isort and black reformatting

Signed-off-by: janekl <[email protected]>

---------

Signed-off-by: Jan Lasek <[email protected]>
Signed-off-by: janekl <[email protected]>
Co-authored-by: janekl <[email protected]>
XuesongYang pushed a commit to paarthneekhara/NeMo that referenced this pull request Jan 18, 2025
* Update vLLMExporter docstring

Signed-off-by: Jan Lasek <[email protected]>

* No need to create empty kwargs here

Signed-off-by: Jan Lasek <[email protected]>

* Use debug from command line

Signed-off-by: Jan Lasek <[email protected]>

* Param save_engine for both both vLLM and TRT-LLM

Signed-off-by: Jan Lasek <[email protected]>

* Unused backend param in run_trt_llm_inference

Signed-off-by: Jan Lasek <[email protected]>

* Reindent files for non-existent checkpoint check

Signed-off-by: Jan Lasek <[email protected]>

* Docs for lora_checkpoints

Signed-off-by: Jan Lasek <[email protected]>

* Improve config readability

Signed-off-by: Jan Lasek <[email protected]>

* Raise error directly in get_vllm_deployable

Signed-off-by: Jan Lasek <[email protected]>

* Apply isort and black reformatting

Signed-off-by: janekl <[email protected]>

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

This reverts commit 8499d50.

Signed-off-by: Jan Lasek <[email protected]>

* Cut off prompt for real

Signed-off-by: Jan Lasek <[email protected]>

* Apply isort and black reformatting

Signed-off-by: janekl <[email protected]>

---------

Signed-off-by: Jan Lasek <[email protected]>
Signed-off-by: janekl <[email protected]>
Co-authored-by: janekl <[email protected]>
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