-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Integrate lm-eval-harness for evaluations in NeMo #10621
base: main
Are you sure you want to change the base?
Conversation
c970d5d
to
30ee09e
Compare
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. |
5fab9e3
to
11993c1
Compare
47fc817
to
bb42ede
Compare
self.add_bos = add_bos | ||
super().__init__() | ||
|
||
def _generate_tokens_logits(self, payload, return_text: bool = False, return_logits: bool = False): |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns Note
[🤖]: Hi @athitten 👋, 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 |
with open("nemo/deploy/service/config.json", "w") as f: | ||
json.dump(args_dict, f) | ||
|
||
|
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.
get_trtllm_deployable() has been moved to nemo/collections/llm/evaluation/eval_utils.py
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.
store_args_to_json() has been removed to avoid creating a new file to store the args. Instead triton args are stored as env vars in deploy() method to access in rest_model_api.py
24a815c
to
3683b81
Compare
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:
Thank you for improving NeMo's documentation! |
[🤖]: Hi @athitten 👋, 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 |
Signed-off-by: Abhishree <[email protected]>
Signed-off-by: Abhishree <[email protected]>
Signed-off-by: Abhishree <[email protected]>
Signed-off-by: athitten <[email protected]>
Signed-off-by: Abhishree <[email protected]>
Signed-off-by: Abhishree <[email protected]>
Signed-off-by: athitten <[email protected]>
Signed-off-by: Abhishree <[email protected]>
Signed-off-by: Abhishree <[email protected]>
1) Refactors the code and creates an evaluation folder where all util methods live 2) Add doctsrings, comments 3) Expose gather_context_logits, gather_generation_logits in trtllm and add output_generation_logits flag to return generation logits and remove output_logporbs as its not getting used anymore Signed-off-by: Abhishree <[email protected]>
Signed-off-by: Abhishree <[email protected]>
f9d9e97
to
18fc260
Compare
Signed-off-by: athitten <[email protected]>
beep boop 🤖: 🚨 The following files must be fixed before merge! Your code was analyzed with PyLint. The following annotations have been identified:
Thank you for improving NeMo's documentation! |
What does this PR do ?
Integrates lm-evaluation-harness into NeMo to run evaluations on standard academic benchmarks.
Evaluations can be run by first deploying the model on PyTriton server via deploy method followed by running the evaluate method to do the actual evaluation.
Collection: This is an independent module and does not affect any collection.
Changelog
deploy
method innemo/collections/llm/api.py
by moving utility funcs tonemo/collections/llm/evaluation/eval_utils.py
. Deploy method takes care of exporting nemo model to trtllm and deploying it on PyTriton server.nemo/deploy/service/rest_model_api.py
which contains the code to interact with the PyTriton Server to perform the actual model inference via/v1/completions
endpoint.nemo/collections/llm/api.py
to evaluate nemo model deployed on PyTriton server (via trtllm) using lm-evaluation-harness.Evaluate method takes in as input the rest service url "http://rest_service_http_address:rest_service_port/v1" and other evaluation params like eval task, num_fewshot, limit etc., and inference params like temperature, top_p, top_k, max_tokens_to_generate
nemo/collections/llm/evaluation/eval_utils.py
that creates a wrapper to interface eval prompts from lm-eval-harness with the model deployed on PyTriton.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