add batching support in inference server
State: closed | Pull request: yes
Labels: name: stale

name: NLP

name: Run CICD

# What does this PR do ?

add batching support in inference server

**Collection**: nlp

# 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**:
- [x] Make sure you read and followed [Contributor guidelines](https://github.com/NVIDIA/NeMo/blob/main/CONTRIBUTING.md)
- [ ] 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**:
- [x] New Feature
- [ ] Bugfix
- [ ] Documentation



[🤖]: Hi @haifengqian 👋,

We wanted to let you know that a [CICD pipeline](https://github.com/NVIDIA/NeMo/actions/runs/12147597441) 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

<!-- pylint-output-strict-mode-false -->

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.collections.nlp.modules.common.text_generation_server
nemo/collections/nlp/modules/common/text_generation_server.py:61:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/nlp/modules/common/text_generation_server.py:72:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_server.py:76:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_server.py:102:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_server.py:172:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_server.py:284:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_server.py:295:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_server.py:461:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/nlp/modules/common/text_generation_server.py:484:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_server.py:26:0: W0611: Unused get_prompt_template_example imported from nemo.collections.nlp.data.language_modeling.megatron.gpt_sft_chat_dataset (unused-import)
************* Module nemo.collections.nlp.modules.common.text_generation_utils
nemo/collections/nlp/modules/common/text_generation_utils.py:261:0: C0301: Line too long (137/119) (line-too-long)
nemo/collections/nlp/modules/common/text_generation_utils.py:695:0: C0301: Line too long (173/119) (line-too-long)
nemo/collections/nlp/modules/common/text_generation_utils.py:701:0: C0301: Line too long (148/119) (line-too-long)
nemo/collections/nlp/modules/common/text_generation_utils.py:931:0: C0301: Line too long (182/119) (line-too-long)
nemo/collections/nlp/modules/common/text_generation_utils.py:934:0: C0301: Line too long (177/119) (line-too-long)
nemo/collections/nlp/modules/common/text_generation_utils.py:942:0: C0301: Line too long (141/119) (line-too-long)
nemo/collections/nlp/modules/common/text_generation_utils.py:987:0: C0301: Line too long (156/119) (line-too-long)
nemo/collections/nlp/modules/common/text_generation_utils.py:1004:0: C0301: Line too long (145/119) (line-too-long)
nemo/collections/nlp/modules/common/text_generation_utils.py:1307:0: C0301: Line too long (120/119) (line-too-long)
nemo/collections/nlp/modules/common/text_generation_utils.py:72:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_utils.py:89:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_utils.py:96:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_utils.py:211:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_utils.py:320:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_utils.py:382:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_utils.py:570:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_utils.py:898:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_utils.py:903:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_utils.py:1101:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_utils.py:17:0: W0611: Unused import os (unused-import)
nemo/collections/nlp/modules/common/text_generation_utils.py:30:0: W0611: Unused DEFAULT_VID_END_TOKEN imported from nemo.collections.multimodal.data.neva.conversation (unused-import)
nemo/collections/nlp/modules/common/text_generation_utils.py:30:0: W0611: Unused DEFAULT_VID_START_TOKEN imported from nemo.collections.multimodal.data.neva.conversation (unused-import)

-----------------------------------
Your code has been rated at 9.65/10
```

---

Thank you for improving NeMo's documentation!

<!-- pylint-output-strict-mode-false -->

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.collections.nlp.modules.common.text_generation_server
nemo/collections/nlp/modules/common/text_generation_server.py:61:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/nlp/modules/common/text_generation_server.py:72:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_server.py:76:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_server.py:102:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_server.py:172:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_server.py:284:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_server.py:295:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_server.py:461:0: C0115: Missing class docstring (missing-class-docstring)
nemo/collections/nlp/modules/common/text_generation_server.py:484:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_server.py:26:0: W0611: Unused get_prompt_template_example imported from nemo.collections.nlp.data.language_modeling.megatron.gpt_sft_chat_dataset (unused-import)
************* Module nemo.collections.nlp.modules.common.text_generation_utils
nemo/collections/nlp/modules/common/text_generation_utils.py:261:0: C0301: Line too long (137/119) (line-too-long)
nemo/collections/nlp/modules/common/text_generation_utils.py:695:0: C0301: Line too long (173/119) (line-too-long)
nemo/collections/nlp/modules/common/text_generation_utils.py:701:0: C0301: Line too long (148/119) (line-too-long)
nemo/collections/nlp/modules/common/text_generation_utils.py:931:0: C0301: Line too long (182/119) (line-too-long)
nemo/collections/nlp/modules/common/text_generation_utils.py:934:0: C0301: Line too long (177/119) (line-too-long)
nemo/collections/nlp/modules/common/text_generation_utils.py:942:0: C0301: Line too long (141/119) (line-too-long)
nemo/collections/nlp/modules/common/text_generation_utils.py:987:0: C0301: Line too long (156/119) (line-too-long)
nemo/collections/nlp/modules/common/text_generation_utils.py:1004:0: C0301: Line too long (145/119) (line-too-long)
nemo/collections/nlp/modules/common/text_generation_utils.py:1307:0: C0301: Line too long (120/119) (line-too-long)
nemo/collections/nlp/modules/common/text_generation_utils.py:72:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_utils.py:89:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_utils.py:96:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_utils.py:211:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_utils.py:320:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_utils.py:382:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_utils.py:570:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_utils.py:898:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_utils.py:903:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_utils.py:1101:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/collections/nlp/modules/common/text_generation_utils.py:17:0: W0611: Unused import os (unused-import)
nemo/collections/nlp/modules/common/text_generation_utils.py:30:0: W0611: Unused DEFAULT_VID_END_TOKEN imported from nemo.collections.multimodal.data.neva.conversation (unused-import)
nemo/collections/nlp/modules/common/text_generation_utils.py:30:0: W0611: Unused DEFAULT_VID_START_TOKEN imported from nemo.collections.multimodal.data.neva.conversation (unused-import)

-----------------------------------
Your code has been rated at 9.65/10
```

---

Thank you for improving NeMo's documentation!

[🤖]: Hi @haifengqian 👋,

We wanted to let you know that a [CICD pipeline](https://github.com/NVIDIA/NeMo/actions/runs/12149573936) 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

This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days.

This PR was closed because it has been inactive for 7 days since being marked as stale.