-
Notifications
You must be signed in to change notification settings - Fork 23
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
Support a Separate GMMU Page Table #109
Conversation
YuWei-CH
commented
Nov 1, 2024
- Get VAddrToPageMapping from driver/internal/memoryallocator.go
- Iterate VAddrToPageMapping in RegisterGPU to store the page in GMMU's page table
@@ -17,6 +17,7 @@ type Builder struct { | |||
useMagicMemoryCopy bool | |||
middlewareD2HCycles int | |||
middlewareH2DCycles int | |||
memorySize uint64 |
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.
Can we name this one as cpuMemorySize
to avoid confusion?
@@ -74,6 +75,12 @@ func (b Builder) WithH2DCycles(h2dCycles int) Builder { | |||
return b | |||
} | |||
|
|||
// WithMemorySize sets the memory size of the CPU. | |||
func (b Builder) WithMemorySize(memorySize uint64) Builder { |
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.
Same here, since this is for CPU, can we just say WithCPUMemorySize
?
d.devices = append(d.devices, gpuDevice) | ||
|
||
for _, page := range d.memAllocator.GetVAddrToPageMapping() { |
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.
Is this required? I think, at the beginning, no page has already been allocated.
@@ -455,6 +462,9 @@ func (d *Driver) distributeWGToGPUs( | |||
panic("not all wg allocated") | |||
} | |||
|
|||
// fmt.Sprintln("total WG: %d WG Per CU %d\n", totalWGCount, wgPerCU) | |||
fmt.Printf("total WG: %d WG Per CU %d\n", totalWGCount, wgPerCU) |
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.
Please remove prints
a.Lock() | ||
defer a.Unlock() | ||
copy := make(map[uint64]vm.Page, len(a.vAddrToPageMapping)) | ||
for vAddr, page := range a.vAddrToPageMapping { |
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.
About empty lines. Please consider these general rules. 1. Add an empty line after defer. 2. Add an empty line before if
and for
. 3 Add an empty line before return
.
if b.perfAnalyzer != nil { | ||
b.perfAnalyzer.RegisterComponent(cp) | ||
} | ||
// if b.perfAnalyzer != nil { |
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.
Is there some problem with perfAnalyzer
? If not, let's do not comment it out.