-
Notifications
You must be signed in to change notification settings - Fork 70
[SymMem 3/5] Add MemoryType::Symmetric
#5518
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
base: sym/symmetric_tensor
Are you sure you want to change the base?
Conversation
Greptile OverviewGreptile SummaryThis PR adds Key changes:
Issue found:
Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant Fusion
participant TensorView
participant HostIrLower
participant HostIrEvaluator
participant SymmetricTensor
User->>Fusion: addInput(tv) / addOutput(tv)
Fusion->>TensorView: getMemoryType()
alt MemoryType != Symmetric
Fusion->>TensorView: setMemoryType(Global)
end
User->>HostIrLower: lower(Fusion)
HostIrLower->>TensorView: getMemoryType()
alt MemoryType != Symmetric
HostIrLower->>TensorView: setMemoryType(Global)
end
HostIrLower->>HostIrLower: Create Allocate HIR nodes
Note over HostIrLower: Uses tv->getMemoryType()
User->>HostIrEvaluator: runWithInput()
HostIrEvaluator->>HostIrEvaluator: handle(kir::Allocate)
HostIrEvaluator->>TensorView: getMemoryType()
alt MemoryType == Symmetric
HostIrEvaluator->>HostIrEvaluator: isTvContiguous(tv)
Note over HostIrEvaluator: Error if not contiguous
HostIrEvaluator->>SymmetricTensor: allocate(sizes, dtype, device)
SymmetricTensor->>SymmetricTensor: Check VMM support
SymmetricTensor->>SymmetricTensor: cuMemCreate with granularity
SymmetricTensor->>SymmetricTensor: cuMemAddressReserve & cuMemMap
SymmetricTensor-->>HostIrEvaluator: at::Tensor
else MemoryType != Symmetric
HostIrEvaluator->>HostIrEvaluator: empty_strided_cuda()
end
|
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.
8 files reviewed, 1 comment
| MemoryType::Global); // TODO: may need a patch to support symmetric | ||
| // memory type |
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.
logic: The TODO is valid - replaceOutput should preserve symmetric memory like addInput and addOutput do
| MemoryType::Global); // TODO: may need a patch to support symmetric | |
| // memory type | |
| if (tv->getMemoryType() != MemoryType::Symmetric) { | |
| tv->setMemoryType(MemoryType::Global); | |
| } |
SymmetricTensorruntime type #5517MemoryType::Symmetric#5518Full branch for reference: #5515