-
Notifications
You must be signed in to change notification settings - Fork 74
Update error regex for topk in opinfo_input_generators.py #5694
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
|
!test |
|
Review updated until commit 0ba42a3 Description
|
| Relevant files | |||
|---|---|---|---|
| Bug fix |
|
PR Reviewer Guide
Here are some key observations to aid the review process:
| 🧪 PR contains tests |
| ⚡ Recommended focus areas for review |
Error Message Regex Validation
|
|
!test |
|
!test |
Greptile SummaryUpdated the error message pattern for
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Test as Test Framework
participant Generator as topk_error_generator
participant Matcher as pytest.raises
participant Regex as _regex_escape_parenthesis
participant TopK as topk Operation
Test->>Generator: Call error generator
Generator->>Generator: Create test tensor (128, 7, 32)
Generator->>Generator: Generate error case: topk(a, k=16, dim=1)
Note over Generator: k=16 exceeds dimension size of 7
Generator->>Test: Yield (SampleInput, RuntimeError, "k .* range")
Test->>Matcher: Setup pytest.raises with error pattern
Matcher->>Regex: Escape parentheses in pattern
Regex->>Matcher: Return escaped pattern
Test->>TopK: Execute topk operation with invalid k
TopK->>TopK: Falls back to aten
TopK->>Test: Raise RuntimeError with message matching "k .* range"
Matcher->>Matcher: Match error message against regex
Note over Matcher: Pattern "k .* range" matches variations like:<br/>"selected index k out of range"<br/>"k out of range"<br/>"k is out of range"
Matcher->>Test: Test passes
|
Greptile's behavior is changing!From now on, if a review finishes with no comments, we will not post an additional "statistics" comment to confirm that our review found nothing to comment on. However, you can confirm that we reviewed your changes in the status check section. This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR". |
So that we have the flexibility to do something with the error checking