Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion KLR/Core/Tensor.lean
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ open Util (FromSexp ToSexp)
-- Memory types on hardware
@[serde tag = 110]
inductive Memory where
| hbm | sbuf | psum | reg
| hbm | sbuf | psum | reg | private_hbm
deriving BEq, FromCBOR, FromJson, FromSexp, Repr, ToCBOR, ToJson, ToSexp

namespace Memory
Expand All @@ -39,6 +39,7 @@ def toName (m : Memory) :=
| .sbuf => `sbuf
| .psum => `psum
| .reg => `reg
| .private_hbm => `private_hbm
end Memory

-- register number
Expand Down
1 change: 1 addition & 0 deletions interop/klr/NKI.asdl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Memory =
| sbuf
| psum
| reg
| private_hbm
Dtype =
| bfloat16
| float8e3
Expand Down
1 change: 1 addition & 0 deletions interop/klr/klir_ast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ enum class Memory {
sbuf,
psum,
reg,
private_hbm,
};

enum class Dtype {
Expand Down
3 changes: 3 additions & 0 deletions interop/klr/klir_pretty_print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ std::string to_string(Memory &MemoryInstance) {
case Memory::reg:
return "reg";
break;
case Memory::private_hbm:
return "private_hbm";
break;
default:
return "UNABLE TO PRINT";
}
Expand Down
6 changes: 6 additions & 0 deletions interop/klr/klir_serde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,12 @@ Memory Memory_des(FILE *in) {
return Memory::reg;
break;
}
case 4: {
if (l != 0)
throw std::runtime_error("Wrong number of elements");
return Memory::private_hbm;
break;
}
default:
throw std::runtime_error("Invalid value tag");
}
Expand Down
Loading