Skip to content

Commit

Permalink
Remove preserve_fp32_precision until it is replaced by unpack_to_dest…
Browse files Browse the repository at this point in the history
…_mode (issue #879)
  • Loading branch information
ddilbazTT committed Oct 9, 2024
1 parent 94d52b5 commit 977591c
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 9 deletions.
5 changes: 2 additions & 3 deletions include/ttmlir/Dialect/TTKernel/IR/TTKernelOpsTypes.td
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ def TTKernel_TensixConfigAttr: TTKernel_Attr<"TensixConfig", "tensix_config", [T
}];
let parameters = (ins "MathFidelity":$math_fidelity,
"bool":$fp32_dest_acc_en,
"bool":$preserve_fp32_precision,
"bool":$math_approx_mode);
let assemblyFormat = "`<` $math_fidelity`,` $fp32_dest_acc_en`,` $preserve_fp32_precision`,` $math_approx_mode `>`";
let assemblyFormat = "`<` $math_fidelity`,` $fp32_dest_acc_en`,` $math_approx_mode `>`";

let extraClassDeclaration = [{
static TensixConfigAttr get(::mlir::MLIRContext *context){
return TensixConfigAttr::get(context, MathFidelity::HiFi4, false, false, false);
return TensixConfigAttr::get(context, MathFidelity::HiFi4, false, false);
};

ThreadType getThreadType() const { return ThreadType::Tensix; }
Expand Down
1 change: 0 additions & 1 deletion include/ttmlir/Target/TTMetal/program.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ table NocConfig {
table TensixConfig {
math_fidelity: MathFidelity;
fp32_dest_acc_en: bool;
preserve_fp32_precision: bool;
math_approx_mode: bool;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/Conversion/TTIRToTTMetal/TTIRToTTMetal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ class TTIRToTTMetalLayoutRewriter : public OpRewritePattern<ttir::ToLayoutOp> {
assert(inputLayout.getGrid() == outputLayout.getGrid());

auto tensixAttr = rewriter.getAttr<ttkernel::TensixConfigAttr>(
ttkernel::MathFidelity::HiFi4, false, false, false);
ttkernel::MathFidelity::HiFi4, false, false);
SmallVector<Attribute> kernelConfigs = {tensixAttr};
SmallVector<Attribute> coreRanges = {
rewriter.getAttr<ttmetal::CoreRangeAttr>(inputLayout.getGrid()),
Expand Down Expand Up @@ -1007,7 +1007,7 @@ class TTIRToTTMetalDispatchRewriter : public OpRewritePattern<ttir::GenericOp> {
}

auto tensixAttr = rewriter.getAttr<ttkernel::TensixConfigAttr>(
ttkernel::MathFidelity::HiFi4, false, false, false);
ttkernel::MathFidelity::HiFi4, false, false);
SmallVector<Attribute> kernelConfigs = {tensixAttr};
SmallVector<Attribute> coreRanges = {
rewriter.getAttr<ttmetal::CoreRangeAttr>(op.getGrid()),
Expand Down
1 change: 0 additions & 1 deletion lib/Target/TTMetal/TTMetalToFlatbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ toFlatbuffer(::flatbuffers::FlatBufferBuilder &fbb,
auto config = ::tt::target::metal::CreateTensixConfig(
fbb, toFlatbuffer(tensixConfigAttr.getMathFidelity()),
tensixConfigAttr.getFp32DestAccEn(),
tensixConfigAttr.getPreserveFp32Precision(),
tensixConfigAttr.getMathApproxMode());
return std::make_pair(configType, config.Union());
}
Expand Down
2 changes: 0 additions & 2 deletions runtime/lib/ttmetal/command_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,6 @@ createKernelConfig(::tt::target::metal::KernelSource const *kernelSource) {

computeConfig.fp32_dest_acc_en =
kernelSource->config_as_TensixConfig()->fp32_dest_acc_en();
computeConfig.preserve_fp32_precision =
kernelSource->config_as_TensixConfig()->preserve_fp32_precision();
computeConfig.math_approx_mode =
kernelSource->config_as_TensixConfig()->math_approx_mode();
return computeConfig;
Expand Down

0 comments on commit 977591c

Please sign in to comment.