Skip to content

fix test error regarding logits_types#2918

Merged
aleozlx merged 2 commits intoflashinfer-ai:mainfrom
aleozlx:logits_type_test_err
Mar 31, 2026
Merged

fix test error regarding logits_types#2918
aleozlx merged 2 commits intoflashinfer-ai:mainfrom
aleozlx:logits_type_test_err

Conversation

@aleozlx
Copy link
Copy Markdown
Collaborator

@aleozlx aleozlx commented Mar 31, 2026

📌 Description

🔍 Related Issues

#2534

(to clarify, not that PR's fault entirely but a CI race condition allowing it to merge)

🚀 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

  • I have installed pre-commit by running pip install pre-commit (or used your preferred method).
  • I have installed the hooks with pre-commit install.
  • 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.

🧪 Tests

  • Tests have been added or updated as needed.
  • All tests are passing (unittest, etc.).

Reviewer Notes

Summary by CodeRabbit

  • Tests
    • Updated tests to exercise mixture-of-experts behavior with different numeric precisions for logits to improve validation across float/bfloat16 configurations.
    • Temporarily skipped a flaky low-level optimization test module due to CI instability on certain runners; investigation ongoing.

@aleozlx
Copy link
Copy Markdown
Collaborator Author

aleozlx commented Mar 31, 2026

/bot run

@flashinfer-bot
Copy link
Copy Markdown
Collaborator

GitLab MR !477 has been created, and the CI pipeline #47302910 is currently running. I'll report back once the pipeline job completes.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates several test cases in tests/moe/test_trtllm_gen_fused_moe.py by explicitly specifying the logits_dtype parameter as either torch.bfloat16 or torch.float32 across various MoE test functions. I have no feedback to provide as there were no review comments to evaluate.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 31, 2026

📝 Walkthrough

Walkthrough

Added explicit logits_dtype arguments to four MoE test invocations to control expert logits dtype, and skipped the entire tinygemm2 test module with a pytest skip due to hangs on CI H100 runners.

Changes

Cohort / File(s) Summary
MoE test dtype updates
tests/moe/test_trtllm_gen_fused_moe.py
Added logits_dtype argument to four run_moe_test(...) calls to set expert logits dtype (torch.bfloat16 or torch.float32) per test.
Skip tinygemm2 tests
tests/model_optimizations/test_tinygemm2.py
Added module-level pytestmark = pytest.mark.skip(reason="tinygemm2 hangs on CI H100 runners — investigation in progress") to unconditionally skip the test file.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Possibly related PRs

Suggested labels

op: moe

Suggested reviewers

  • yzh119
  • cyx-6
  • jiahanc
  • jimmyzho
  • nv-yunzheq

Poem

🐰 I hopped through tests with careful paws,
Four dtypes set without a single pause,
One module sleeps to keep CI calm,
Expert logits hum a quiet psalm,
Hops and bits — a tiny rabbit's charm.

🚥 Pre-merge checks | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is largely incomplete, containing only the template placeholder comments without any actual implementation details about the changes made or why they are needed. Fill in the Description section with details about what was fixed (logits_dtype arguments in MOE tests and tinygemm2 test skip), and explain why these changes were necessary to address the CI issues.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'fix test error regarding logits_types' is vague and generic, using non-descriptive language that doesn't clearly convey what specific test errors were fixed. Provide a more specific title such as 'Add logits_dtype arguments to MOE tests and skip tinygemm2 tests' to clearly describe the actual changes made.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Collaborator

@samuellees samuellees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM~

@aleozlx aleozlx enabled auto-merge (squash) March 31, 2026 02:15
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a 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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tests/model_optimizations/test_tinygemm2.py`:
- Around line 6-8: Replace the unconditional module-wide skip by using
flashinfer.utils.get_compute_capability() to only skip on CI H100 runners:
remove the current pytestmark = pytest.mark.skip(...) and instead set pytestmark
= pytest.mark.skipif(<condition>, reason=...) where <condition> checks
get_compute_capability() == "h100" (and optionally that CI is set, e.g.,
os.environ.get("CI") is truthy) so tests still run locally; import
get_compute_capability from flashinfer.utils and os if you use the CI env check
and reference the pytestmark symbol in this file.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: be85d081-a97f-4ce0-9f06-8ef5f8df4cf7

📥 Commits

Reviewing files that changed from the base of the PR and between 9eefed6 and 362957e.

📒 Files selected for processing (1)
  • tests/model_optimizations/test_tinygemm2.py

Comment on lines +6 to +8
pytestmark = pytest.mark.skip(
reason="tinygemm2 hangs on CI H100 runners — investigation in progress"
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether tinygemm2 is globally skipped vs conditionally skipped.
# Expected: no unconditional module-level "pytest.mark.skip(" in this file.
rg -n --type=py '^\s*pytestmark\s*=\s*pytest\.mark\.skip\(' tests/model_optimizations/test_tinygemm2.py
rg -n --type=py '^\s*pytestmark\s*=\s*pytest\.mark\.skipif\(' tests/model_optimizations/test_tinygemm2.py
rg -n --type=py 'get_compute_capability|is_sm90a_supported|is_sm100a_supported' tests/model_optimizations/test_tinygemm2.py

Repository: flashinfer-ai/flashinfer

Length of output: 211


Replace global module skip with conditional CI/H100 skip.

Line 6 disables all tinygemm2 tests everywhere, removing useful regression coverage. Per coding guidelines, use flashinfer.utils.get_compute_capability() to conditionally skip only on the problematic CI H100 environment.

Proposed change
+import os
 import torch
 import pytest
 import torch.nn.functional as F
 from flashinfer.utils import get_compute_capability
 
-pytestmark = pytest.mark.skip(
-    reason="tinygemm2 hangs on CI H100 runners — investigation in progress"
-)
+def _is_ci_h100():
+    cc = get_compute_capability(torch.device("cuda"))
+    return os.getenv("CI") == "true" and cc[0] == 9
+
+pytestmark = pytest.mark.skipif(
+    _is_ci_h100(),
+    reason="tinygemm2 hangs on CI H100 runners — investigation in progress",
+)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
pytestmark = pytest.mark.skip(
reason="tinygemm2 hangs on CI H100 runners — investigation in progress"
)
import os
import torch
import pytest
import torch.nn.functional as F
from flashinfer.utils import get_compute_capability
def _is_ci_h100():
cc = get_compute_capability(torch.device("cuda"))
return os.getenv("CI") == "true" and cc[0] == 9
pytestmark = pytest.mark.skipif(
_is_ci_h100(),
reason="tinygemm2 hangs on CI H100 runners — investigation in progress",
)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/model_optimizations/test_tinygemm2.py` around lines 6 - 8, Replace the
unconditional module-wide skip by using
flashinfer.utils.get_compute_capability() to only skip on CI H100 runners:
remove the current pytestmark = pytest.mark.skip(...) and instead set pytestmark
= pytest.mark.skipif(<condition>, reason=...) where <condition> checks
get_compute_capability() == "h100" (and optionally that CI is set, e.g.,
os.environ.get("CI") is truthy) so tests still run locally; import
get_compute_capability from flashinfer.utils and os if you use the CI env check
and reference the pytestmark symbol in this file.

@flashinfer-bot
Copy link
Copy Markdown
Collaborator

[FAILED] Pipeline #47302910: 10/20 passed

@aleozlx aleozlx merged commit 998aa5d into flashinfer-ai:main Mar 31, 2026
33 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants