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
2 changes: 0 additions & 2 deletions KLR/Core/Operators.lean
Original file line number Diff line number Diff line change
Expand Up @@ -990,8 +990,6 @@ structure QuantizeMX where
dst : TensorRef -- NOTE: do we need special tensor types for MX ones. ISA does
src : TensorRef
dstScale : TensorRef
scalePIDX: Nat

deriving BEq, FromCBOR, FromJson, FromSexp, Repr, ToCBOR, ToJson, ToSexp

instance : MapTensorRefs QuantizeMX where
Expand Down
2 changes: 0 additions & 2 deletions KLR/Trace/ISA.lean
Original file line number Diff line number Diff line change
Expand Up @@ -904,13 +904,11 @@ nki builtin.isa.quantize_mx
(dst : Access)
(src: Access)
(dst_scale : Access)
(scale_partition_index : Nat := 0)
(name : Option String := none) := do
Trace.add_stmt $ .oper (.quantizeMX {
dst := .abstract dst,
src := .abstract src,
dstScale := .abstract dst_scale,
scalePIDX := scale_partition_index
}) name
return .none

Expand Down
2 changes: 1 addition & 1 deletion interop/klr/NKI.asdl
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ SendRecv = (TensorRef dst, TensorRef src, Immediate sendToRank, Immediate recvFr

SendRecvCompute = (TensorRef* dsts, TensorRef* srcs, Immediate* sendToRanks, Immediate* recvFromRanks, Immediate pipeId, AluOp op)

QuantizeMX = (TensorRef dst, TensorRef src, TensorRef dstScale, Nat scalePIDX)
QuantizeMX = (TensorRef dst, TensorRef src, TensorRef dstScale)

MatMulMX = (TensorRef dst, TensorRef stationary, TensorRef moving, TensorRef stationaryScale, TensorRef movingScale, Nat*? tilePosition, Nat*? tileSize)

Expand Down
1 change: 0 additions & 1 deletion interop/klr/klir_ast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,6 @@ struct QuantizeMX final {
Ptr<TensorRef> dst;
Ptr<TensorRef> src;
Ptr<TensorRef> dstScale;
Nat scalePIDX;
};

struct MatMulMX final {
Expand Down
3 changes: 0 additions & 3 deletions interop/klr/klir_pretty_print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2427,9 +2427,6 @@ std::string to_string(QuantizeMX &QuantizeMXInstance) {
result += ", ";
result += "dstScale=";
result += to_string(*(QuantizeMXInstance.dstScale.get()));
result += ", ";
result += "scalePIDX=";
result += std::to_string(QuantizeMXInstance.scalePIDX);
result += ")";
return result;
};
Expand Down
9 changes: 3 additions & 6 deletions interop/klr/klir_serde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2441,16 +2441,14 @@ bool SendRecvCompute_ser(FILE *out, const Ptr<SendRecvCompute> &value) {
}

bool QuantizeMX_ser(FILE *out, const Ptr<QuantizeMX> &value) {
if (!serialize_tag(out, 195, 0, 4))
if (!serialize_tag(out, 195, 0, 3))
return false;
if (!TensorRef_ser(out, value->dst))
return false;
if (!TensorRef_ser(out, value->src))
return false;
if (!TensorRef_ser(out, value->dstScale))
return false;
if (!Nat_ser(out, value->scalePIDX))
return false;
return true;
}

Expand Down Expand Up @@ -6303,17 +6301,16 @@ Ptr<QuantizeMX> QuantizeMX_des(FILE *in) {
msg << "Could not find tag, expecting QuantizeMX:195,0";
throw std::runtime_error(msg.str());
}
if (t != 195 || c != 0 || l != 4) {
if (t != 195 || c != 0 || l != 3) {
std::ostringstream msg;
msg << "Expecting QuantizeMX:(195,0,4)";
msg << "Expecting QuantizeMX:(195,0,3)";
msg << " got:(" << (int)t << "," << (int)c << "," << (int)l << ")";
throw std::runtime_error(msg.str());
}
Ptr<QuantizeMX> x = ptr<QuantizeMX>();
x->dst = TensorRef_des(in);
x->src = TensorRef_des(in);
x->dstScale = TensorRef_des(in);
x->scalePIDX = Nat_des(in);
return x;
}

Expand Down
Loading