-
Notifications
You must be signed in to change notification settings - Fork 2k
[ci] Speedup beam search unit tests with fixtures for LLM #5843
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
184fbe3 to
6d6cc02
Compare
|
/bot run --stage-list "A30-PyTorch-1" |
|
PR_Github #11292 [ run ] triggered by Bot |
|
PR_Github #11292 [ run ] completed with state |
6d6cc02 to
b3bdf4b
Compare
|
/bot run |
|
PR_Github #11941 [ run ] triggered by Bot |
|
PR_Github #11941 [ run ] completed with state |
|
/bot run --disable-fail-fast |
|
PR_Github #11956 [ run ] triggered by Bot |
|
PR_Github #11956 [ run ] completed with state |
omera-nv
left a comment
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.
LGTM test-wise: the tests are now 48secs instead of 10mins, great work :)
b3bdf4b to
44a5d25
Compare
|
""" WalkthroughThe changes introduce a runtime check in the model engine to prevent the use of CUDA Graphs with beam search, adjust the way cumulative log probabilities are accessed in the sampler, and refactor beam search tests to use pytest fixtures for modularity and clarity. No public API signatures are altered. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant PyTorchModelEngine
participant CUDA_Graphs
User->>PyTorchModelEngine: Initialize with config (may enable CUDA Graphs, set beam width)
PyTorchModelEngine->>PyTorchModelEngine: Check if CUDA Graphs enabled and beam width > 1
alt Invalid combination
PyTorchModelEngine-->>User: Raise NotImplementedError
else Valid configuration
PyTorchModelEngine-->>User: Proceed with initialization
end
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
⏰ 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
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
44a5d25 to
7d25f49
Compare
|
/bot run |
|
PR_Github #12198 [ run ] triggered by Bot |
|
PR_Github #12198 [ run ] completed with state |
7d25f49 to
26fc029
Compare
|
/bot run |
|
PR_Github #12216 [ run ] triggered by Bot |
|
PR_Github #12216 [ run ] completed with state |
…ts and expected outputs - Introduced pytest fixtures for input prompts and expected outputs to improve test readability and maintainability. - Refactored the test function to utilize these fixtures, simplifying the parameter list and enhancing clarity. - Introduced pytest fixture for LLM to skip rebuilding LLM for each test - disabled threadleak to prevent failure, due to LLM not being shutdown after each test - Updated assertions to ensure correct behavior of the beam search output shapes. Signed-off-by: Stefan Niebler <[email protected]>
- Added a NotImplementedError to raise an exception if CUDA Graph is enabled with a max beam width greater than 1, indicating that this combination is not yet supported. - Corrected the indexing for cumulative log probabilities in the sampler to ensure proper data access. - Updated the LLM fixture in unit tests to use a dynamic max batch size based on input prompts, improving memory management and preventing potential data access issues. Signed-off-by: Stefan Niebler <[email protected]>
- enabled similarity check if less than max_beam_width outputs are returned. - moved KvCacheConfig into the llm fixture Signed-off-by: Stefan Niebler <[email protected]>
26fc029 to
561657f
Compare
|
/bot run |
|
PR_Github #12295 [ run ] triggered by Bot |
|
PR_Github #12295 [ run ] completed with state |
Signed-off-by: Stefan Niebler <[email protected]>
Signed-off-by: Stefan Niebler <[email protected]>
Signed-off-by: Stefan Niebler <[email protected]> Signed-off-by: Shreyas Misra <[email protected]>
Description
CI/refactor: Speedup beam search unit tests with fixtures for LLMs, prompts and expected outputs
Introduced pytest fixtures for input prompts and expected outputs to improve test readability and maintainability.
Refactored the test function to utilize these fixtures, simplifying the parameter list and enhancing clarity.
Introduced pytest fixture for LLM to skip rebuilding LLM for each test
disabled threadleak to prevent failure, due to LLM not being shutdown after each test
Updated assertions to ensure correct behavior of the beam search output shapes.
updated small issues related to beam search
Throw NotImplemented Error, when beam search is executed with CUDA Graph
Fix Indexing Error in cum_log_probs
Test Coverage
test_beam_search.py
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 [--disable-fail-fast --skip-test --stage-list "A10-1, xxx" --gpu-type "A30, H100_PCIe" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-[Post-Merge]-1, xxx"]Launch build/test pipelines. All previously running jobs will be killed.
--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-1, xxx"(OPTIONAL) : Only run the specified test stages. Examples: "A10-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.--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. Will also run 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-[Post-Merge]-1, xxx"(OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Examples: --extra-stage "H100_PCIe-[Post-Merge]-1, xxx".For guidance on mapping tests to stage names, see
docs/source/reference/ci-overview.md.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.
Summary by CodeRabbit
Bug Fixes
Tests