-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new general convolution op and layout attribute, convert stablehl…
…o convolution to it (#1104) Add pass to transform eligible ConvolutionOp --> Conv2dOp in TTIR Introduce reshapes in ttir->ttnn conversion of conv2d Use output memory config specification feature recently added to ttnn::conv2d create dedicated silicon tests
- Loading branch information
Showing
17 changed files
with
792 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// SPDX-FileCopyrightText: (c) 2024 Tenstorrent AI ULC | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#ifndef TTMLIR_TTIR_ATTRS_TD | ||
#define TTMLIR_TTIR_ATTRS_TD | ||
|
||
include "mlir/IR/AttrTypeBase.td" | ||
include "ttmlir/Dialect/TTIR/IR/TTIRBase.td" | ||
|
||
def TTIR_ConvolutionLayoutAttr : AttrDef<TTIR_Dialect, "ConvolutionLayout", [], "::mlir::Attribute"> { | ||
let mnemonic = "convolution_layout"; | ||
let summary = "Structure of dimension information for convolution op"; | ||
let description = [{ | ||
Holds the layout information for the input activation, weights, and output. | ||
}]; | ||
let parameters = (ins | ||
"int64_t":$inputBatchDimension, | ||
"int64_t":$inputFeatureDimension, | ||
ArrayRefParameter<"int64_t">:$inputSpatialDimensions, | ||
|
||
"int64_t":$kernelOutputFeatureDimension, | ||
"int64_t":$kernelInputFeatureDimension, | ||
ArrayRefParameter<"int64_t">:$kernelSpatialDimensions, | ||
|
||
"int64_t":$outputBatchDimension, | ||
"int64_t":$outputFeatureDimension, | ||
ArrayRefParameter<"int64_t">:$outputSpatialDimensions | ||
); | ||
|
||
let assemblyFormat = [{ | ||
`input_batch` `=` $inputBatchDimension `,` | ||
`input_feature` `=` $inputFeatureDimension`,` | ||
`input_spatial_dimensions` `=` custom<DimensionList>($inputSpatialDimensions) `,` | ||
`kernel_output_feature` `=` $kernelOutputFeatureDimension `,` | ||
`kernel_input_feature` `=` $kernelInputFeatureDimension `,` | ||
`kernel_spatial_dimensions` `=` custom<DimensionList>($kernelSpatialDimensions) `,` | ||
`output_batch` `=` $outputBatchDimension `,` | ||
`output_feature` `=` $outputFeatureDimension `,` | ||
`output_spatial_dimensions` `=` custom<DimensionList>($outputSpatialDimensions) | ||
}]; | ||
} | ||
|
||
#endif // TTMLIR_TTIR_ATTRS_TD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.