| ### Operations and types supported by the target. ### |
| target { |
| tgt.i2f(%x) : (i32) -> f32, (vector<8x128xi32>) -> vector<8x128xf32>; |
| tgt.f2i(%x) : (f32) -> i32, (vector<8x128xf32>) -> vector<8x128xi32>; |
| tgt.neg(%x) : vector<8x128xf32>, f32; # vector<128xf32> |
| |
| tgt.add(%x, %y) : vector<128xf32>, vector<8x128xf32>, f32; |
| tgt.sub(%x, %y) : vector<128xf32>, vector<8x128xf32>, f32; |
| tgt.mul(%x, %y) : vector<128xf32>, vector<8x128xf32>, f32; |
| |
| tgt.matmul(%x, %y) : (vector<128x128xf32>, vector<128x128xf32>) -> vector<128x128xf32>; |
| } |
| |
| ### Map LAVM ops to previously defined target ops or their combinations. ### |
| # current restriction is that lavm ops on the lhs should appear with same arg names and count |
| map { |
| lavm.neg(%a) : tgt.neg(%a); |
| lavm.neg(%a) : tgt.neg(tgt.i2f(%a)); |
| |
| lavm.add(%a, %b) : tgt.add(%a, %b), |
| tgt.add(tgt.i2f(%a), tgt.i2f(%b)); |
| |
| lavm.sub(%a, %b) : lavm.add(%a, lavm.neg(%b)); |
| |
| lavm.matmul(%a, %b) : tgt.matmul(%a, %b); |
| } |
| |
| ### Target memory description. ### |
| memory { |
| |
| # TPU-like memory: |
| HBM : size = 16G; |
| HBM : garbage = ignored; |
| VMEM : size = 16M; |
| SMEM : size = 16K; |
| CMEM : size = 16M; |
| HBM -> VMEM; |
| VMEM -> HBM; |
| HBM -> SMEM; |
| SMEM -> HBM; |
| HBM -> CMEM -> VMEM; |
| VMEM -> CMEM -> HBM; |
| # GPU-like memory: |
| GLOBAL : size = 8G; |
| SHARED : size = 16M; |
| LOCAL : size = 1M; |
| # CPU-like memory: |
| MEMORY : size = 64GB; |
| $L1 : size = 512K; |
| $L2 : size = 4M; |
| MEMORY -> $L2 -> $L1; |
| $L1 -> $L2 -> MEMORY; |
| } |