-
Notifications
You must be signed in to change notification settings - Fork 74
Enable TensorIndexer with the matmul scheduler tests #5725
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 --diff |
|
Review updated until commit 28ce887 Description
|
| Relevant files | |||
|---|---|---|---|
| Bug fix |
| ||
| Enhancement |
|
PR Reviewer Guide
Here are some key observations to aid the review process:
| 🧪 PR contains tests |
| ⚡ Recommended focus areas for review |
Logic Reordering
|
Greptile SummaryFixed a critical ordering issue in circular buffer index allocation and enabled TensorIndexer for matmul scheduler tests. Key Changes:
Why This Matters: Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Test as Matmul Test
participant IdModel as IdModel
participant CircularBuffer as CircularBufferInfo
participant IndexMap as Index Variable Maps
Test->>IdModel: Enable TensorIndexer (IdModel "all")
Test->>IdModel: allocateLoopIndexVariables()
loop For each loop_group
IdModel->>CircularBuffer: isCircularBufferedIterDomain()?
alt Is Circular Buffered (NEW: Check First)
CircularBuffer-->>IdModel: true
IdModel->>IndexMap: Allocate CircularBufferIndices
Note over IdModel,IndexMap: Create index for each stage<br/>(Main, Prolog, Epilog)
IdModel->>IdModel: continue (skip other checks)
else Not Circular Buffered
CircularBuffer-->>IdModel: false
IdModel->>IdModel: Check shouldUseZeroIndex()
alt Should use zero (extent=1 or broadcast)
IdModel->>IndexMap: Assign fusion_->zeroVal()
IdModel->>IdModel: continue
else Should use parallel index
IdModel->>IndexMap: Assign NamedScalar::getParallelIndex()
IdModel->>IdModel: continue
else Regular loop index needed
IdModel->>IndexMap: Allocate new Val(DataType::Index)
end
end
end
Note over Test,IndexMap: Later during execution...
Test->>IdModel: getLoopIndexVariable(loop_group, stage)
IdModel->>CircularBuffer: isCircularBufferedIterDomain()?
CircularBuffer-->>IdModel: true
IdModel->>IndexMap: Get circular buffer index for stage
alt Index exists (FIXED)
IndexMap-->>IdModel: Return index variable
IdModel-->>Test: Success
else Index missing (OLD BUG)
IndexMap-->>IdModel: Not found
IdModel->>IdModel: NVF_ERROR (catch bug early)
end
|
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". |
|
!test --diff |
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.
2 files reviewed, 1 comment
|
!test |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
|
!test |
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.
Additional Comments (1)
-
tests/cpp/test_matmul_scheduler.cpp, line 3333 (link)logic: missing parent class
SetUpcall - other test classes callNVFuserFixtureParamTest::SetUp()first
2 files reviewed, 1 comment
…into tensorindexer_matmul_scheduler
|
!test |
This PR also fixes the initial index assignment, where we always need to allocate circular-buffer specific indices when circular buffering is used. This usually doesn't matter, but some of the tests have some trivial patterns where the loop extent is just 1 but still uses circular buffering, in that case the current code simply assigns zero. https://github.com/NVIDIA/Fuser/blob/main/csrc/id_model/id_model.cpp#L1354