Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

YuWei-CH
Copy link

@YuWei-CH YuWei-CH commented Nov 1, 2024

  1. Get VAddrToPageMapping from driver/internal/memoryallocator.go
  2. Iterate VAddrToPageMapping in RegisterGPU to store the page in GMMU's page table

@YuWei-CH YuWei-CH marked this pull request as draft November 1, 2024 20:53
@YuWei-CH YuWei-CH closed this Nov 1, 2024
@YuWei-CH YuWei-CH reopened this Nov 1, 2024
@YuWei-CH YuWei-CH marked this pull request as ready for review November 1, 2024 20:57
@@ -17,6 +17,7 @@ type Builder struct {
useMagicMemoryCopy bool
middlewareD2HCycles int
middlewareH2DCycles int
memorySize uint64
Copy link
Contributor

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 {
Copy link
Contributor

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() {
Copy link
Contributor

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)
Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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.

@YuWei-CH YuWei-CH closed this Nov 9, 2024
@DX990307 DX990307 linked an issue Nov 11, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Separate GMMU Page Table
2 participants