model: support nvidia/Llama-3_3-Nemotron-Super-49B-v1#9067
Conversation
There was a problem hiding this comment.
Summary of Changes
Hello @netanel-haber, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
I've implemented a new feature to support the nvidia/Llama-3_3-Nemotron-Super-49B-v1 model within the system. This involved adding the complete model architecture, including its decoder layers and overall structure, and integrating it with the existing framework's components like the language model head and sampler. Additionally, I've updated model configuration logic to correctly handle this new model type and made significant improvements to the underlying utility functions, enhancing support for pipeline parallelism and refining the weight loading process for better flexibility and robustness.
Highlights
- New Model Support: I've added comprehensive support for the
nvidia/Llama-3_3-Nemotron-Super-49B-v1model, which includes defining its specific architecture and ensuring compatibility with the existing framework. - Nemotron-NAS Model Implementation: I've introduced a new file,
python/sglang/srt/models/nemotron_nas.py, which contains the full implementation of the Nemotron-NAS model, including its decoder layers, main model structure, and causal language model capabilities. - Model Configuration Update: I've updated the
model_config.pyto correctly calculate the number of KV heads fornemotron-nasmodels, ensuring proper configuration and operation. - Framework Utility Enhancements: I've significantly refactored and enhanced the utility functions in
utils.py, particularly improving support for pipeline parallelism and introducing a more robust and flexible weight loading mechanism withAutoWeightsLoaderandPPMissingLayer.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request adds support for the nvidia/Llama-3_3-Nemotron-Super-49B-v1 model. The changes include a new model definition file, updates to the model configuration to handle this new architecture, and modifications to utility functions. While the core model implementation seems reasonable, there are some issues with the pipeline parallelism setup in the new model file that need to be addressed. Additionally, a critical issue was found in python/sglang/srt/utils.py where necessary imports were removed, which would cause runtime errors.
e8a40a5 to
33ab5b2
Compare
e7dd0af to
e97839d
Compare
b97d9d1 to
259e251
Compare
|
Tagged @merrymercy @zhyncs in the community slack PR channel |
b3c3bdb to
5169de4
Compare
|
Hey @zhyncs - I think all of the failing tests are due to general flakiness and nothing to do with my changes, and Mick approved. What should my next steps be? |
Co-authored-by: Kyle Huang <kylhuang@nvidia.com>
Co-authored-by: Kyle Huang <kylhuang@nvidia.com>
Based on: #5073
Motivation
Add support for nvidia/Llama-3_3-Nemotron-Super-49B-v1 and v1.5.
Modifications
Porting nemotron_nas from VLLM.
Sanity Testing
`python3 -m sglang.bench_one_batch` vs `python3.12 scripts/playground/reference_hf.py` - H200 140GB
MMLU-Pro on V1.5: Published HF Results vs. SgLang run
0.7950.785[Run on:H200X5 140GB]SgLang: Reproduction and Results
python -m sglang.launch_server --model-path "nvidia/Llama-3_3-Nemotron-Super-49B-v1_5" --host 0.0.0.0 --port 30000 --served-model-name "Llama-3_3-Nemotron-Super-49B-v1_5" --context-length 65536 --random-seed 1 --trust-remote-code --dp-size 5lm_eval --model local-chat-completions --model_args model=nvidia/Llama-3_3-Nemotron-Super-49B-v1_5,base_url=http://localhost:30000/v1/chat/completions,api_key=EMPTY,num_concurrent=320,timeout=3600 --tasks mmlu_pro --apply_chat_template --system_instruction "" --gen_kwargs temperature=0.6,top_p=0.95,do_sample=true,seed=1 --log_samplesChecklist
Please feel free to join our Slack channel at https://slack.sglang.ai/ to discuss your PR.