-
Notifications
You must be signed in to change notification settings - Fork 2k
[#7208][fix] Fix config type of MedusaConfig #7320
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
Conversation
Signed-off-by: Kanghwan Jang <861393+karljang@users.noreply.github.com>
📝 WalkthroughWalkthroughMedusaConfig selection logic was fixed: it now reads Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Caller as User code
participant Medusa as MedusaConfig.__init__
participant QWen as QWenConfig
participant LLaMA as LLaMAConfig
Caller->>Medusa: MedusaConfig(**kwargs)
Medusa->>Medusa: model_type = str(kwargs.get('model_type','')).lower()
alt model_type contains "qwen"
Medusa->>QWen: instantiate QWenConfig(**kwargs)
QWen-->>Medusa: QWenConfig instance
else
Medusa->>LLaMA: instantiate LLaMAConfig(**kwargs)
LLaMA-->>Medusa: LLaMAConfig instance
end
Medusa->>Medusa: set self.config and num_medusa_heads
Medusa-->>Caller: MedusaConfig instance
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Assessment against linked issues
(Only objectives from the linked issue were assessed.) 📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
|
/bot run |
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.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
tensorrt_llm/models/medusa/config.py(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
**/*.py: Code must target Python 3.8+
Indent Python code with 4 spaces; do not use tabs
Preserve module namespaces when importing; import modules/packages and access members via the module (e.g., from package.subpackage import foo; foo.SomeClass())
Python file names should be snake_case
Python class names should be PascalCase
Python functions/methods and local variables should be snake_case; variables beginning with a number should be prefixed with k_ (e.g., k_99th_percentile)
Global variables should be UPPER_SNAKE_CASE prefixed with G_ (e.g., G_MY_GLOBAL); constants should be UPPER_SNAKE_CASE
Avoid shadowing variables from outer scopes; initialize all externally visible members in init
Prefer docstrings for interfaces used outside a file; comments should be reserved for in-function or file-local interfaces
Use Google-style docstrings for classes and functions; attributes and variables may be documented inline with trailing string literals
Avoid reflection when simpler, explicit code suffices (e.g., avoid dict(**locals()) patterns)
In try/except, catch the narrowest exceptions possible
For duck-typing patterns, keep the try body minimal and move logic to else to avoid masking unrelated failures
Files:
tensorrt_llm/models/medusa/config.py
**/*.{c,cc,cpp,cxx,h,hh,hpp,hxx,cu,cuh,py}
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
Prepend the NVIDIA copyright header (current year) to all source files (.cpp, .h, .cu, .py, etc.)
Files:
tensorrt_llm/models/medusa/config.py
🧬 Code graph analysis (1)
tensorrt_llm/models/medusa/config.py (2)
tensorrt_llm/models/qwen/config.py (1)
QWenConfig(23-210)tensorrt_llm/models/llama/config.py (1)
LLaMAConfig(27-278)
🪛 Ruff (0.12.2)
tensorrt_llm/models/medusa/config.py
34-34: Undefined name QWenConfig
(F821)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Pre-commit Check
|
PR_Github #16754 [ run ] triggered by Bot |
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
tensorrt_llm/models/medusa/config.py (1)
36-38: Correct config dispatch; prefer startswith and clearer name (minor)Logic now correctly derives from kwargs and avoids KeyError. For precision and readability:
- Use startswith to avoid accidental substring matches.
- Name the local to reflect it holds a class.
Apply:
- model_type = str(kwargs.get('model_type', '')).lower() - generic_medusa_config = QWenConfig if 'qwen' in model_type else LLaMAConfig - self.config = generic_medusa_config(**kwargs) + model_type = str(kwargs.get('model_type', '')).lower() + backing_config_cls = QWenConfig if model_type.startswith('qwen') else LLaMAConfig + self.config = backing_config_cls(**kwargs)If useful, I can add a regression test asserting:
- MedusaConfig(model_type="qwen"), "QWEN", "qwen2_moe" → QWenConfig
- MedusaConfig(model_type="llama") or missing → LLaMAConfig
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
tensorrt_llm/models/medusa/config.py(2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
**/*.py: Code must target Python 3.8+
Indent Python code with 4 spaces; do not use tabs
Preserve module namespaces when importing; import modules/packages and access members via the module (e.g., from package.subpackage import foo; foo.SomeClass())
Python file names should be snake_case
Python class names should be PascalCase
Python functions/methods and local variables should be snake_case; variables beginning with a number should be prefixed with k_ (e.g., k_99th_percentile)
Global variables should be UPPER_SNAKE_CASE prefixed with G_ (e.g., G_MY_GLOBAL); constants should be UPPER_SNAKE_CASE
Avoid shadowing variables from outer scopes; initialize all externally visible members in init
Prefer docstrings for interfaces used outside a file; comments should be reserved for in-function or file-local interfaces
Use Google-style docstrings for classes and functions; attributes and variables may be documented inline with trailing string literals
Avoid reflection when simpler, explicit code suffices (e.g., avoid dict(**locals()) patterns)
In try/except, catch the narrowest exceptions possible
For duck-typing patterns, keep the try body minimal and move logic to else to avoid masking unrelated failures
Files:
tensorrt_llm/models/medusa/config.py
**/*.{c,cc,cpp,cxx,h,hh,hpp,hxx,cu,cuh,py}
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
Prepend the NVIDIA copyright header (current year) to all source files (.cpp, .h, .cu, .py, etc.)
Files:
tensorrt_llm/models/medusa/config.py
🧬 Code graph analysis (1)
tensorrt_llm/models/medusa/config.py (2)
tensorrt_llm/models/qwen/config.py (1)
QWenConfig(23-210)tensorrt_llm/models/llama/config.py (1)
LLaMAConfig(27-278)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Pre-commit Check
🔇 Additional comments (1)
tensorrt_llm/models/medusa/config.py (1)
22-22: Import fix unblocks QWen selectionGood add. Resolves the undefined name and enables the correct config dispatch.
Signed-off-by: Kanghwan Jang <861393+karljang@users.noreply.github.com>
81c8bef to
084a884
Compare
Signed-off-by: Kanghwan Jang <861393+karljang@users.noreply.github.com>
|
PR_Github #16754 [ run ] completed with state |
|
/bot run |
|
PR_Github #16902 [ run ] triggered by Bot |
|
PR_Github #16902 [ run ] completed with state |
Subject: Follow-up on PR #7320 for MedusaConfig Bug FixHi @karljang, I hope you’re doing well! I noticed that the PR (#7320) you opened for the MedusaConfig bug fix didn't succeed, as per the CI/CD logs. It seems there is a failing check (blossom-ci) in the workflow, and I wanted to bring this to your attention in case it's something that can be addressed. Here's the detailed status of the CI/CD checks from the recent PR run: 1 failing check: blossom-ci 4 successful checks Would you be able to take another look when you have a moment? Thanks again for your attention to this, and I really appreciate your help in resolving the issue! Best regards, |
|
No worries~ I was looking into it, but need some time~ :) |
|
/bot run |
|
PR_Github #17035 [ run ] triggered by Bot |
|
PR_Github #17035 [ run ] completed with state |
|
Hi @karljang — following up on #7320. Could you please check the job logs and the result artifact path? If GB200 resources are temporarily unavailable, would you consider making this stage non-blocking or conditionally skipping it when resources are missing to avoid blocking the merge (and if blossom-ci is marked as Required, adjusting the configuration accordingly so the check doesn’t go red)? Thanks! |
|
/bot run |
|
PR_Github #17378 [ run ] triggered by Bot |
|
PR_Github #17378 [ run ] completed with state |
|
/bot run |
|
PR_Github #17426 [ run ] triggered by Bot |
|
PR_Github #17426 [ run ] completed with state |
|
Just an update. There are some failed tests in the Jenkins, and I need more time to figure it out. :) |
|
/bot run --disable-fail-fast |
|
PR_Github #17573 [ run ] triggered by Bot |
|
PR_Github #17573 [ run ] completed with state |
Got it, I’ll keep following up on the progress. Thanks for your hard work! @karljang |
Signed-off-by: Kanghwan Jang <861393+karljang@users.noreply.github.com>
This PR fixes #7208.
Summary by CodeRabbit
Refactor
Bug Fixes
Description
Test Coverage
GitHub Bot Help
/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...Provide a user friendly way for developers to interact with a Jenkins server.
Run
/bot [-h|--help]to print this help message.See details below for each supported subcommand.
Details
run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental)]Launch build/test pipelines. All previously running jobs will be killed.
--reuse-test (optional)pipeline-id(OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.--disable-reuse-test(OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.--disable-fail-fast(OPTIONAL) : Disable fail fast on build/tests/infra failures.--skip-test(OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.--stage-list "A10-PyTorch-1, xxx"(OPTIONAL) : Only run the specified test stages. Examples: "A10-PyTorch-1, xxx". Note: Does NOT update GitHub check status.--gpu-type "A30, H100_PCIe"(OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.--test-backend "pytorch, cpp"(OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.--only-multi-gpu-test(OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.--disable-multi-gpu-test(OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.--add-multi-gpu-test(OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline.--post-merge(OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx"(OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx".--detailed-log(OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.--debug(OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in thestage-listparameter to access the appropriate container environment. Note: Does NOT update GitHub check status.For guidance on mapping tests to stage names, see
docs/source/reference/ci-overview.mdand the
scripts/test_to_stage_mapping.pyhelper.kill
killKill all running builds associated with pull request.
skip
skip --comment COMMENTSkip testing for latest commit on pull request.
--comment "Reason for skipping build/test"is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.reuse-pipeline
reuse-pipelineReuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.