-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Conversation
Signed-off-by: Jan Lasek <[email protected]>
Signed-off-by: Jan Lasek <[email protected]>
Signed-off-by: Jan Lasek <[email protected]>
Signed-off-by: Jan Lasek <[email protected]>
Signed-off-by: Jan Lasek <[email protected]>
Signed-off-by: Jan Lasek <[email protected]>
Signed-off-by: Jan Lasek <[email protected]>
Signed-off-by: Jan Lasek <[email protected]>
Signed-off-by: Jan Lasek <[email protected]>
Signed-off-by: janekl <[email protected]>
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
There was a problem hiding this comment.
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 <[email protected]>
Signed-off-by: Jan Lasek <[email protected]>
) | ||
return exporter | ||
except Exception as error: | ||
raise RuntimeError("An error has occurred during the model export. Error message: " + str(error)) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed here
Signed-off-by: Jan Lasek <[email protected]>
Signed-off-by: janekl <[email protected]>
@@ -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]) :] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explained here #10941 (comment)
[🤖]: 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 |
* 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]>
* 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]>
* 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]>
* 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]>
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
Usage
# 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:
PR Type:
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