test: Skip sm90 test in test_jit_warmup.py if not on sm90#2189
test: Skip sm90 test in test_jit_warmup.py if not on sm90#2189yzh119 merged 1 commit intoflashinfer-ai:mainfrom
Conversation
WalkthroughA pytest skip decorator is added to Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (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)
🔇 Additional comments (2)
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. Comment |
Summary of ChangesHello @bkryu, 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! This pull request enhances the stability and relevance of the test suite by preventing a specific test, Highlights
Using Gemini Code AssistThe 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 by creating a comment using either
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 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. 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
|
There was a problem hiding this comment.
Code Review
This pull request correctly adds a pytest.mark.skipif decorator to skip a test for the SM90 architecture when not running on corresponding hardware. My review includes a suggestion to make this condition more robust by checking for CUDA availability and using a more precise utility function that also verifies the required CUDA version. This will improve test reliability and maintain consistency with the library's internal checks.
As a minor note, I noticed a typo in the test function names: test_warmpup_llama and test_warmpup_llama_sm90. You might want to correct this to test_warmup_... for better clarity and consistency.
| @pytest.mark.skipif( | ||
| torch.cuda.get_device_capability()[0] != 9, | ||
| reason="fa3 backend is only supported on SM90", | ||
| ) |
There was a problem hiding this comment.
The skipif condition can be made more robust and accurate.
- It should check if CUDA is available before attempting to get device capabilities. This will prevent test collection errors in non-CUDA environments.
- It's better to use the existing helper
flashinfer.utils.is_sm90a_supportedto check for SM90 support. This function is more precise as it checks for both the compute capability (major version 9) and the required minimum CUDA version (>=12.3), which is necessary forfa3backend support.
Using this helper makes the test condition consistent with the implementation's support checks.
@pytest.mark.skipif(
not torch.cuda.is_available()
or not flashinfer.utils.is_sm90a_supported(torch.device("cuda")),
reason="fa3 backend requires SM90 with CUDA >= 12.3",
)|
/bot run |
…-ai#2189) <!-- .github/pull_request_template.md --> ## 📌 Description `test_jit_warmup.py` contains two tests `test_warmpup_llama` and `test_warmpup_llama_sm90` where the _sm90 variant is the first one plus an additional fa3 prefill compilation only supported on SM90. While under general circumstances, this test should pass on non-sm90 cards, it might fail if the environment contains an incomplete `flashinfer-jit-cache` that is missing sm90 kernels and `FLASHINFER_CUDA_ARCH_LIST` is not correctly set to include 9.0a. Since: 1. This can interfere with unit testing by causing unexpected failures on non SM90 cards and 2. On non SM90 cards, there is no additional gain from testing sm90 kernel compilation current PR disables it. <!-- What does this PR do? Briefly describe the changes and why they’re needed. --> ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete. ### ✅ Pre-commit Checks - [x] I have installed `pre-commit` by running `pip install pre-commit` (or used your preferred method). - [x] I have installed the hooks with `pre-commit install`. - [x] I have run the hooks manually with `pre-commit run --all-files` and fixed any reported issues. > If you are unsure about how to set up `pre-commit`, see [the pre-commit documentation](https://pre-commit.com/). ## 🧪 Tests - [ ] Tests have been added or updated as needed. - [ ] All tests are passing (`unittest`, etc.). ## Reviewer Notes <!-- Optional: anything you'd like reviewers to focus on, concerns, etc. --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Updated test execution conditions to ensure tests run only on supported hardware configurations. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
📌 Description
test_jit_warmup.pycontains two teststest_warmpup_llamaandtest_warmpup_llama_sm90where the _sm90 variant is the first one plus an additional fa3 prefill compilation only supported on SM90.While under general circumstances, this test should pass on non-sm90 cards, it might fail if the environment contains an incomplete
flashinfer-jit-cachethat is missing sm90 kernels andFLASHINFER_CUDA_ARCH_LISTis not correctly set to include 9.0a.Since:
current PR disables it.
🔍 Related Issues
🚀 Pull Request Checklist
Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete.
✅ Pre-commit Checks
pre-commitby runningpip install pre-commit(or used your preferred method).pre-commit install.pre-commit run --all-filesand fixed any reported issues.🧪 Tests
unittest, etc.).Reviewer Notes
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.