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 dram memory space in metal direct #584

Merged
merged 1 commit into from
Sep 4, 2024
Merged

Support dram memory space in metal direct #584

merged 1 commit into from
Sep 4, 2024

Conversation

nsmithtt
Copy link
Contributor

@nsmithtt nsmithtt commented Sep 2, 2024

This change adds support for the device dram memory space in metal
backend. This required a few bits of refactoring including:

  • DeviceAttr splits out worker grid from L1 map, they now respectively
    map the physical compute cores and the physical L1 memory map.
  • DeviceAttr gets a new map, dramMap, which maps a linear tensor
    coordinate to a physical dram address.
  • Change projectOnto to take an arbitrary affine map instead of a grid
    attr. This let's us pass in unique affine map for L1 or DRAM or Eth
    (in the future) to the same interface.
  • PhysicalCoreCoordMapping can now take an L1 grid or a DRAM grid.
  • Giving explicit enum index names for the DeviceAttr affine map
    results.
  • Noc datamovement program can now be generated as reads or writes,
    necessary for writing to DRAM since dram cores do not have risc.

Closes #359

Comment on lines 733 to 734
mlir::ArrayRef<CoreCoordAttr> dramCores, unsigned dramChannelSize,
unsigned dramAddressAlignBytes, unsigned dramPageSize) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dramChannelSize, dramAddressAlignBytes are unused params

}

static mlir::AffineMap
createDramMap(::mlir::MLIRContext *context, GridAttr workerGrid, ArchAttr arch,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you could just add comment for both functions createL1Map, createDramMap how map looks like for an example grid.

This change adds support for the device dram memory space in metal
backend.  This required a few bits of refactoring including:

- `DeviceAttr` splits out worker grid from L1 map, they now respectively
  map the physical compute cores and the physical L1 memory map.
- `DeviceAttr` gets a new map, `dramMap`, which maps a linear tensor
  coordinate to a physical dram address.
- Change `projectOnto` to take an arbitrary affine map instead of a grid
  attr.  This let's us pass in unique affine map for L1 or DRAM or Eth
  (in the future) to the same interface.
- `PhysicalCoreCoordMapping` can now take an L1 grid or a DRAM grid.
- Giving explicit enum index names for the DeviceAttr affine map
  results.
- Noc datamovement program can now be generated as reads or writes,
  necessary for writing to DRAM since dram cores do not have risc.

Closes #359
@nsmithtt nsmithtt merged commit 9c61739 into main Sep 4, 2024
13 checks passed
@nsmithtt nsmithtt deleted the nsmith/dram2 branch September 4, 2024 22:04
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.

DRAM Grid on DeviceAttr
2 participants